[0.11] gst-plugins-good: qtdemux: increase parse tolerance for fuzzy file cases

Sebastian Dröge slomo at kemper.freedesktop.org
Tue Jan 10 05:33:02 PST 2012


Module: gst-plugins-good
Branch: 0.11
Commit: ed3f89fad57dc43f225a4fe973e0e28d27c03538
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=ed3f89fad57dc43f225a4fe973e0e28d27c03538

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Wed Feb  9 15:31:22 2011 +0100

qtdemux: increase parse tolerance for fuzzy file cases

---

 gst/isomp4/qtdemux.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 037f29e..14d5413 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -5306,8 +5306,13 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl)
   GST_LOG_OBJECT (qtdemux, "%u timestamp blocks", stream->n_sample_times);
 
   /* make sure there's enough data */
-  if (!qt_atom_parser_has_chunks (&stream->stts, stream->n_sample_times, 2 * 4))
-    goto corrupt_file;
+  if (!qt_atom_parser_has_chunks (&stream->stts, stream->n_sample_times, 8)) {
+    stream->n_sample_times = gst_byte_reader_get_remaining (&stream->stts) / 8;
+    GST_LOG_OBJECT (qtdemux, "overriding to %u timestamp blocks",
+        stream->n_sample_times);
+    if (!stream->n_sample_times)
+      goto corrupt_file;
+  }
 
   /* sync sample atom */
   stream->stps_present = FALSE;



More information about the gstreamer-commits mailing list