diff options
author | Thiago Santos <ts.santos@partner.samsung.com> | 2013-09-24 10:07:25 -0700 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-09-30 10:23:24 +0200 |
commit | 980c195db2b46b1d9b198a9e504adf02a8c05f5b (patch) | |
tree | 69000958fa9a3cd09287f471d96b7b54434f24ef | |
parent | a6b510218794dfcd3789714427f09fdc4ed8e2e9 (diff) | |
download | gstreamer-980c195db2b46b1d9b198a9e504adf02a8c05f5b.tar.gz |
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
-rw-r--r-- | gst/asfdemux/gstasfdemux.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 4c4278dcce..a19d223ce6 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -3574,8 +3574,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", |