diff options
author | Edward Hervey <edward@centricular.com> | 2017-06-27 11:48:08 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2017-06-27 11:49:48 +0200 |
commit | 86422147335662a7217942e8dac79729d2789420 (patch) | |
tree | d77642bbb886cb0b31dab86e95a1a73e69e08631 | |
parent | 578fd2e077941ed1b168fa3b6f4262ed4f26ad42 (diff) |
asfdemux: More index handling
In the same vein as the previous commit, the end of the file might have been
cut and therefore contains bogus data.
If the object is too short, consider it as garbage and return a non-fatal
flow.
Regression introduced in 97294eb8bbed1b9dad7d3f2c52dd69eb1812cc06
-rw-r--r-- | gst/asfdemux/gstasfdemux.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index ff063a7b..d81ad167 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -1124,13 +1124,21 @@ gst_asf_demux_pull_indices (GstASFDemux * demux) gst_buffer_unmap (buf, &map); gst_buffer_replace (&buf, NULL); + if (ret == ASF_FLOW_NEED_MORE_DATA) { + /* Since indices are at the end of the file, if we need more data, + * we consider it as a non-fatal corrupted index */ + ret = GST_FLOW_OK; + break; + } + if (G_UNLIKELY (ret != GST_FLOW_OK)) break; ++num_read; } - GST_DEBUG_OBJECT (demux, "read %u index objects", num_read); + GST_DEBUG_OBJECT (demux, "read %u index objects , returning %s", num_read, + gst_flow_get_name (ret)); return ret; } |