]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-good0-10.git/commitdiff
isomp4: recovery: add sanity check
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Fri, 20 Jan 2012 16:01:37 +0000 (17:01 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 23 Jan 2012 18:30:53 +0000 (18:30 +0000)
... on possibly bogus/corrupt input data.

gst/isomp4/atomsrecovery.c

index 1190ec1ca6464e7f09d231ba0871369f8ba37bfb..1d53ed844271ef4ec7f3599bfc050ad54b4cca02 100644 (file)
@@ -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++) {