qtdemux: fix: sample description index override in tfhd not evaluated
authorJürgen Sachs <juergen.sachs@metz-ce.de>
Tue, 11 Apr 2017 11:41:48 +0000 (13:41 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 12 Apr 2017 09:04:46 +0000 (11:04 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=778337

gst/isomp4/qtdemux.c

index 64277f1..41fea0c 100644 (file)
@@ -3426,9 +3426,12 @@ qtdemux_parse_tfhd (GstQTDemux * qtdemux, GstByteReader * tfhd,
       default_sample_duration, default_sample_size, default_sample_flags);
 
   /* FIXME: Handle TF_SAMPLE_DESCRIPTION_INDEX properly */
-  if (flags & TF_SAMPLE_DESCRIPTION_INDEX)
-    if (!gst_byte_reader_skip (tfhd, 4))
+  if (flags & TF_SAMPLE_DESCRIPTION_INDEX) {
+    guint32 sample_description_index;
+    if (!gst_byte_reader_get_uint32_be (tfhd, &sample_description_index))
       goto invalid_track;
+    (*stream)->stsd_sample_description_id = sample_description_index - 1;
+  }
 
   if (flags & TF_DEFAULT_SAMPLE_DURATION)
     if (!gst_byte_reader_get_uint32_be (tfhd, default_sample_duration))