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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e3b28f10bb
commit
aae4f5108d
@ -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);
|
||||
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);
|
||||
if (!mxf->local_tags)
|
||||
return AVERROR(ENOMEM);
|
||||
|
Loading…
x
Reference in New Issue
Block a user