From 3137f26544eeff0aaf2bec05417aa85bbd19931c Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 20 Jan 2012 17:01:37 +0100 Subject: [PATCH] isomp4: recovery: add sanity check ... on possibly bogus/corrupt input data. --- gst/isomp4/atomsrecovery.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/isomp4/atomsrecovery.c b/gst/isomp4/atomsrecovery.c index 1190ec1ca6..1d53ed8442 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++) {