qtdemux: Check if there's actually a seek table before parsing it
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 11 Dec 2010 16:49:03 +0000 (17:49 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 11 Dec 2010 16:49:03 +0000 (17:49 +0100)
gst/qtdemux/qtdemux.c

index 5a6fb7e1f71dae69e9ca9c15155eee7e9d3c4b09..dac0db10e255a30ef7c286f0dfe794a3470e8cc3 100644 (file)
@@ -876,6 +876,9 @@ gst_qtdemux_find_index_for_given_media_offset_linear (GstQTDemux * qtdemux,
   QtDemuxSample *result = str->samples;
   guint32 index = 0;
 
   QtDemuxSample *result = str->samples;
   guint32 index = 0;
 
+  if (result == NULL || str->n_samples == 0)
+    return -1;
+
   if (media_offset == result->offset)
     return index;
 
   if (media_offset == result->offset)
     return index;