summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorThiago Santos <ts.santos@partner.samsung.com>2013-09-24 10:07:25 -0700
committerThiago Santos <ts.santos@partner.samsung.com>2013-09-24 14:43:34 -0700
commitabe5ca6d962fdd34c1292b71f72495475eac2174 (patch)
treef79bad6b7932db4297aed9b32e9ff49287fafa97 /gst
parenta8beacf6e59a01684e217fdbb66f605d874c176a (diff)
asfdemux: Parse last simple index entry
The entry size is fixed at 6, fix typo to finish parsing the index correctly until the last sample
Diffstat (limited to 'gst')
-rw-r--r--gst/asfdemux/gstasfdemux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index ec44035f..0432503a 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -3571,8 +3571,13 @@ gst_asf_demux_process_simple_index (GstASFDemux * demux, guint8 * data,
demux->sidx_entries = g_new0 (AsfSimpleIndexEntry, count);
for (i = 0; i < count; ++i) {
- if (G_UNLIKELY (size <= 6))
+ if (G_UNLIKELY (size < 6)) {
+ /* adjust for broken files, to avoid having entries at the end
+ * of the parsed index that point to time=0. Resulting in seeking to
+ * the end of the file leading back to the beginning */
+ demux->sidx_num_entries -= (count - i);
break;
+ }
demux->sidx_entries[i].packet = gst_asf_demux_get_uint32 (&data, &size);
demux->sidx_entries[i].count = gst_asf_demux_get_uint16 (&data, &size);
GST_LOG_OBJECT (demux, "%" GST_TIME_FORMAT " = packet %4u count : %2d",