diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-15 02:16:18 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-15 06:08:28 +0200 |
commit | aae4f5108d04041bb264a9c547f05c4f0d18c9c7 (patch) | |
tree | 1d7a3fe9028998f67decde1fba17a264e047bfda | |
parent | e3b28f10bb9b6750c97ee282a7e656d60d6d9e34 (diff) | |
download | ffmpeg-aae4f5108d04041bb264a9c547f05c4f0d18c9c7.tar.gz |
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>
-rw-r--r-- | libavformat/mxfdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 25240e79ee..19c6374961 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -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); |