codec-utils: Avoid out-of-bounds error
authorDavid Svensson Fors <davidsf@axis.com>
Mon, 7 Feb 2022 08:30:58 +0000 (09:30 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 10 Feb 2022 07:58:36 +0000 (07:58 +0000)
commitb3d300bc26f05e0e2efaa59a2f240125d0cbfef5
tree8514e115314429567603994667e94513085a1e41
parent7a9e11ae1bf56809bdeda27d6bbbb9cb7e40b0f5
codec-utils: Avoid out-of-bounds error

For artificial input (in unit tests), all six bytes of
constraint_indicator_flags in hevc_caps_get_mime_codec() can be
zero. Add a guard against an out-of-bounds error that occurred in that
case. Change variables to signed int so comparison with -1 works.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1677>
subprojects/gst-plugins-base/gst-libs/gst/pbutils/codec-utils.c