Commit 940417ed authored by Mark Nauwelaerts's avatar Mark Nauwelaerts

avidemux: ensure sane parameters when parsing superindex

parent d680842a
......@@ -1270,6 +1270,11 @@ gst_avi_demux_parse_superindex (GstAviDemux * avi,
GST_DEBUG_OBJECT (avi, "got %d indexes", num);
/* this can't work out well ... */
if (num > G_MAXUINT32 >> 1 || bpe < 8) {
goto invalid_params;
}
indexes = g_new (guint64, num + 1);
for (i = 0; i < num; i++) {
if (size < 24 + bpe * (i + 1))
......@@ -1293,6 +1298,14 @@ too_small:
gst_buffer_unref (buf);
return FALSE;
}
invalid_params:
{
GST_ERROR_OBJECT (avi, "invalid index parameters (num = %d, bpe = %d)",
num, bpe);
if (buf)
gst_buffer_unref (buf);
return FALSE;
}
}
/* add an entry to the index of a stream. @num should be an estimate of the
......
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