Commit aae4f510 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mxfdec: Fix memleak of primer_packs

Fixes: asan_static-oob_87d116_10_201.mxf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e3b28f10
...@@ -426,6 +426,10 @@ static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, U ...@@ -426,6 +426,10 @@ static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, U
av_log(mxf->fc, AV_LOG_ERROR, "item_num %d is too large\n", item_num); av_log(mxf->fc, AV_LOG_ERROR, "item_num %d is too large\n", item_num);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (mxf->local_tags)
av_log(mxf->fc, AV_LOG_VERBOSE, "Multiple primer packs\n");
av_free(mxf->local_tags);
mxf->local_tags_count = 0;
mxf->local_tags = av_calloc(item_num, item_len); mxf->local_tags = av_calloc(item_num, item_len);
if (!mxf->local_tags) if (!mxf->local_tags)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
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