[FFmpeg-cvslog] avformat/mxfdec: Fix memleak of primer_packs

Michael Niedermayer git at videolan.org
Wed Oct 15 06:09:20 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct 15 02:16:18 2014 +0200| [aae4f5108d04041bb264a9c547f05c4f0d18c9c7] | committer: 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: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aae4f5108d04041bb264a9c547f05c4f0d18c9c7
---

 libavformat/mxfdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 25240e7..19c6374 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);



More information about the ffmpeg-cvslog mailing list