提交 b4800b8b 编写于 作者: B Baptiste Coudurier

protect realloc overflow

Originally committed as revision 18088 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 b9b4fc5e
......@@ -364,6 +364,8 @@ static int mxf_read_primer_pack(MXFContext *mxf)
static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set)
{
if (mxf->metadata_sets_count+1 >= UINT_MAX / sizeof(*mxf->metadata_sets))
return AVERROR(ENOMEM);
mxf->metadata_sets = av_realloc(mxf->metadata_sets, (mxf->metadata_sets_count + 1) * sizeof(*mxf->metadata_sets));
if (!mxf->metadata_sets)
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册