mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
avidemux: ensure sane parameters when parsing superindex
This commit is contained in:
parent
d680842a7f
commit
940417edc3
1 changed files with 13 additions and 0 deletions
|
@ -1270,6 +1270,11 @@ gst_avi_demux_parse_superindex (GstAviDemux * avi,
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (avi, "got %d indexes", num);
|
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);
|
indexes = g_new (guint64, num + 1);
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
if (size < 24 + bpe * (i + 1))
|
if (size < 24 + bpe * (i + 1))
|
||||||
|
@ -1293,6 +1298,14 @@ too_small:
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
return FALSE;
|
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
|
/* add an entry to the index of a stream. @num should be an estimate of the
|
||||||
|
|
Loading…
Reference in a new issue