qtdemux: Check multi trex to find track id in mp4 mpeg-dash stream

If stream has more than one trex box which is not matched to actual
track id, it makes qtdemux crashed.

Author : Manasa Athreya (manasa.athreya@lge.com)

https://bugzilla.gnome.org/show_bug.cgi?id=754864
This commit is contained in:
Manasa Athreya 2015-09-23 12:39:35 +09:00 committed by Sebastian Dröge
parent b71068e42d
commit e6a4c81af5

View file

@ -8423,6 +8423,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
guint32 fourcc; guint32 fourcc;
guint value_size, stsd_len, len; guint value_size, stsd_len, len;
guint32 track_id; guint32 track_id;
guint32 dummy;
GST_DEBUG_OBJECT (qtdemux, "parse_trak"); GST_DEBUG_OBJECT (qtdemux, "parse_trak");
@ -8454,6 +8455,8 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
gst_qtdemux_stream_flush_segments_data (qtdemux, stream); gst_qtdemux_stream_flush_segments_data (qtdemux, stream);
gst_qtdemux_stream_flush_samples_data (qtdemux, stream); gst_qtdemux_stream_flush_samples_data (qtdemux, stream);
} }
/* need defaults for fragments */
qtdemux_parse_trex (qtdemux, stream, &dummy, &dummy, &dummy);
if (stream->pending_tags == NULL) if (stream->pending_tags == NULL)
stream->pending_tags = gst_tag_list_new_empty (); stream->pending_tags = gst_tag_list_new_empty ();
@ -10023,7 +10026,6 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
goto samples_failed; goto samples_failed;
if (qtdemux->fragmented) { if (qtdemux->fragmented) {
guint32 dummy;
guint64 offset; guint64 offset;
/* need all moov samples as basis; probably not many if any at all */ /* need all moov samples as basis; probably not many if any at all */
@ -10041,8 +10043,6 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
GST_CLOCK_TIME_IS_VALID (qtdemux->segment.duration)) GST_CLOCK_TIME_IS_VALID (qtdemux->segment.duration))
stream->duration = stream->duration =
GSTTIME_TO_QTSTREAMTIME (stream, qtdemux->segment.duration); GSTTIME_TO_QTSTREAMTIME (stream, qtdemux->segment.duration);
/* need defaults for fragments */
qtdemux_parse_trex (qtdemux, stream, &dummy, &dummy, &dummy);
} }
/* configure segments */ /* configure segments */