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:34 +0200 |
commit | 0834f2056c7f1a0c09129802a003465e0ebcc9b8 (patch) | |
tree | efb460419b43d597dd8873df0991e799c6d931b9 | |
parent | aae4f5108d04041bb264a9c547f05c4f0d18c9c7 (diff) | |
download | ffmpeg-0834f2056c7f1a0c09129802a003465e0ebcc9b8.tar.gz |
avformat/mxfdec: Fix memleak of packages_refs
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 | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 19c6374961..05ac0a16e8 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -624,6 +624,9 @@ static int mxf_read_content_storage(void *arg, AVIOContext *pb, int tag, int siz MXFContext *mxf = arg; switch (tag) { case 0x1901: + if (mxf->packages_refs) + av_log(mxf->fc, AV_LOG_VERBOSE, "Multiple packages_refs\n"); + av_free(mxf->packages_refs); mxf->packages_count = avio_rb32(pb); mxf->packages_refs = av_calloc(mxf->packages_count, sizeof(UID)); if (!mxf->packages_refs) |