qtdemux: Make sure there are enough offsets to read when parsing samples
authorSebastian Dröge <sebastian@centricular.com>
Fri, 27 Sep 2024 07:38:50 +0000 (10:38 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 3 Dec 2024 20:35:20 +0000 (22:35 +0200)
commit7f8f280555201f51898727919831259e68271868
treeb8d9b8dd65bf2a344a768043f01133a7197e756d
parent8e884e4e31649a9fc19095d6501a1143b074aba8
qtdemux: Make sure there are enough offsets to read when parsing samples

While this specific case is also caught when initializing co_chunk, the error
is ignored in various places and calling into the function would lead to out of
bounds reads if the error message doesn't cause the pipeline to be shut down
fast enough.

To avoid this, no matter what, make sure enough offsets are available when
parsing them. While this is potentially slower, the same is already done in the
non-chunks_are_samples case.

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-245
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3847

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8060>
subprojects/gst-plugins-good/gst/isomp4/qtdemux.c