Commit 26f98696 authored by Edward Hervey's avatar Edward Hervey 🤘 Committed by Edward Hervey

qtdemux: Add out-of-bound check

Make sure we don't read invalid memory
parent 9ac3861a
...@@ -7964,8 +7964,16 @@ gst_qtdemux_stream_check_and_change_stsd_index (GstQTDemux * demux, ...@@ -7964,8 +7964,16 @@ gst_qtdemux_stream_check_and_change_stsd_index (GstQTDemux * demux,
GST_DEBUG_OBJECT (stream->pad, "Changing stsd index from '%u' to '%u'", GST_DEBUG_OBJECT (stream->pad, "Changing stsd index from '%u' to '%u'",
stream->cur_stsd_entry_index, stream->stsd_sample_description_id); stream->cur_stsd_entry_index, stream->stsd_sample_description_id);
stream->cur_stsd_entry_index = stream->stsd_sample_description_id; if (G_UNLIKELY (stream->stsd_sample_description_id >=
stream->new_caps = TRUE; stream->stsd_entries_length)) {
(_("This file is invalid and cannot be played.")),
("New sample description id is out of bounds (%d >= %d)",
stream->stsd_sample_description_id, stream->stsd_entries_length));
} else {
stream->cur_stsd_entry_index = stream->stsd_sample_description_id;
stream->new_caps = TRUE;
} }
static gboolean static gboolean
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment