OSDN Git Service

mxf: Fix potential leak in mxf_read_local_tags()
authorTomas Härdin <tomas.hardin@codemill.se>
Wed, 24 Oct 2012 14:54:25 +0000 (16:54 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Tue, 14 Jan 2014 17:23:00 +0000 (18:23 +0100)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/mxfdec.c

index c25fd11..cb383b0 100644 (file)
@@ -1648,6 +1648,9 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
         /* Accept the 64k local set limit being exceeded (Avid). Don't accept
          * it extending past the end of the KLV though (zzuf5.mxf). */
         if (avio_tell(pb) > klv_end) {
+            if (ctx_size)
+                av_free(ctx);
+
             av_log(mxf->fc, AV_LOG_ERROR,
                    "local tag %#04x extends past end of local set @ %#"PRIx64"\n",
                    tag, klv->offset);