diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-01-20 17:01:37 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-01-23 18:30:53 +0000 |
commit | c51636b829e24fb57e62ea1448eb475bf1400125 (patch) | |
tree | 00e7f7def29c0e61c86c74ebf1b70c0c2057e845 | |
parent | 886e72ddb2887e36613a791e91dac9c7787e4332 (diff) |
isomp4: recovery: add sanity check
... on possibly bogus/corrupt input data.
-rw-r--r-- | 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 1190ec1ca..1d53ed844 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++) { |