h265parser: Fix possible overflow using max_sub_layers_minus1
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 9 Aug 2023 16:49:19 +0000 (12:49 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 20 Sep 2023 10:19:06 +0000 (11:19 +0100)
commitfddda166222a067d0e511950a0a8cfb9f5a521b7
tree29f1ddd4c2211a16f985babff56af9e2be0027ad
parent9394979d67c2c0093e163d2cefd0bd54503e85a0
h265parser: Fix possible overflow using max_sub_layers_minus1

This fixes a possible overflow that can be triggered by an invalid value of
max_sub_layers_minus1 being set in the bitstream. The bitstream uses 3 bits,
but the allowed range is 0 to 6 only.

Fixes ZDI-CAN-21768, CVE-2023-40476

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2895

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5366>
subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c