gst-plugins-good: isomp4: recovery: add sanity check

Mark Nauwelaerts mnauw at kemper.freedesktop.org
Fri Jan 20 08:24:27 PST 2012


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

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Fri Jan 20 17:01:37 2012 +0100

isomp4: recovery: add sanity check

... on possibly bogus/corrupt input data.

---

 gst/isomp4/atomsrecovery.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/gst/isomp4/atomsrecovery.c b/gst/isomp4/atomsrecovery.c
index 1190ec1..1d53ed8 100644
--- a/gst/isomp4/atomsrecovery.c
+++ b/gst/isomp4/atomsrecovery.c
@@ -681,6 +681,13 @@ moov_recov_file_create (FILE * file, GError ** err)
     goto fail;
   }
 
+  /* sanity check */
+  if (moovrf->num_traks > 1024) {
+    g_set_error (err, ATOMS_RECOV_QUARK, ATOMS_RECOV_ERR_PARSING,
+        "Unsupported number of traks");
+    goto fail;
+  }
+
   /* init the traks */
   moovrf->traks_rd = g_new0 (TrakRecovData, moovrf->num_traks);
   for (i = 0; i < moovrf->num_traks; i++) {



More information about the gstreamer-commits mailing list