Commit 3137f265 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

isomp4: recovery: add sanity check

... on possibly bogus/corrupt input data.
parent ed94e012
...@@ -681,6 +681,13 @@ moov_recov_file_create (FILE * file, GError ** err) ...@@ -681,6 +681,13 @@ moov_recov_file_create (FILE * file, GError ** err)
goto fail; 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 */ /* init the traks */
moovrf->traks_rd = g_new0 (TrakRecovData, moovrf->num_traks); moovrf->traks_rd = g_new0 (TrakRecovData, moovrf->num_traks);
for (i = 0; i < moovrf->num_traks; i++) { for (i = 0; i < moovrf->num_traks; i++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment