mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
qtdemux: Fix crash on mss stream caused by invalid stsd entry access
Since mss has no moov, default stsd entry should be created with media-caps. https://bugzilla.gnome.org/show_bug.cgi?id=782042
This commit is contained in:
parent
4ae022e6c4
commit
66448be77f
1 changed files with 9 additions and 0 deletions
|
@ -1971,6 +1971,10 @@ gst_qtdemux_setcaps (GstQTDemux * demux, GstCaps * caps)
|
||||||
stream = _create_stream ();
|
stream = _create_stream ();
|
||||||
demux->streams[demux->n_streams] = stream;
|
demux->streams[demux->n_streams] = stream;
|
||||||
demux->n_streams = 1;
|
demux->n_streams = 1;
|
||||||
|
/* mss has no stsd/stsd entry, use id 0 as default */
|
||||||
|
stream->stsd_entries_length = 1;
|
||||||
|
stream->stsd_sample_description_id = stream->cur_stsd_entry_index = 0;
|
||||||
|
stream->stsd_entries = g_new0 (QtDemuxStreamStsdEntry, 1);
|
||||||
} else {
|
} else {
|
||||||
stream = demux->streams[0];
|
stream = demux->streams[0];
|
||||||
}
|
}
|
||||||
|
@ -3444,6 +3448,11 @@ qtdemux_parse_tfhd (GstQTDemux * qtdemux, GstByteReader * tfhd,
|
||||||
(*stream)->stsd_sample_description_id = sample_description_index - 1;
|
(*stream)->stsd_sample_description_id = sample_description_index - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (qtdemux->mss_mode) {
|
||||||
|
/* mss has no stsd entry */
|
||||||
|
(*stream)->stsd_sample_description_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (flags & TF_DEFAULT_SAMPLE_DURATION)
|
if (flags & TF_DEFAULT_SAMPLE_DURATION)
|
||||||
if (!gst_byte_reader_get_uint32_be (tfhd, default_sample_duration))
|
if (!gst_byte_reader_get_uint32_be (tfhd, default_sample_duration))
|
||||||
goto invalid_track;
|
goto invalid_track;
|
||||||
|
|
Loading…
Reference in a new issue