Commit 356adfc5 authored by bcoudurier's avatar bcoudurier

protect realloc overflow

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18088 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d93c5903
...@@ -364,6 +364,8 @@ static int mxf_read_primer_pack(MXFContext *mxf) ...@@ -364,6 +364,8 @@ static int mxf_read_primer_pack(MXFContext *mxf)
static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set) 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)); mxf->metadata_sets = av_realloc(mxf->metadata_sets, (mxf->metadata_sets_count + 1) * sizeof(*mxf->metadata_sets));
if (!mxf->metadata_sets) if (!mxf->metadata_sets)
return -1; return -1;
......
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