File gstreamer-plugins-bad-CVE-2023-40474.patch of Package gstreamer-plugins-bad.31362

diff -Nura gst-plugins-bad-1.16.3/gst-libs/gst/codecparsers/gsth265parser.c gst-plugins-bad-1.16.3_new/gst-libs/gst/codecparsers/gsth265parser.c
--- gst-plugins-bad-1.16.3/gst-libs/gst/codecparsers/gsth265parser.c	2019-04-19 17:16:36.000000000 +0800
+++ gst-plugins-bad-1.16.3_new/gst-libs/gst/codecparsers/gsth265parser.c	2023-10-31 17:57:01.973660749 +0800
@@ -1490,6 +1490,7 @@
 
   READ_UINT8 (&nr, vps->max_layers_minus1, 6);
   READ_UINT8 (&nr, vps->max_sub_layers_minus1, 3);
+  CHECK_ALLOWED (vps->max_sub_layers_minus1, 0, 6);
   READ_UINT8 (&nr, vps->temporal_id_nesting_flag, 1);
 
   /* skip reserved_0xffff_16bits */
@@ -1669,6 +1670,7 @@
   sps->vps = vps;
 
   READ_UINT8 (&nr, sps->max_sub_layers_minus1, 3);
+  CHECK_ALLOWED (sps->max_sub_layers_minus1, 0, 6);
   READ_UINT8 (&nr, sps->temporal_id_nesting_flag, 1);
 
   if (!gst_h265_parse_profile_tier_level (&sps->profile_tier_level, &nr,
openSUSE Build Service is sponsored by