[FFmpeg-cvslog] mxf: Fix potential leak in mxf_read_local_tags()

Tomas Härdin git at videolan.org
Tue Jan 14 23:09:28 CET 2014


ffmpeg | branch: master | Tomas Härdin <tomas.hardin at codemill.se> | Wed Oct 24 16:54:25 2012 +0200| [cc1e3ace63075ccd75ef3a2acdeb2e81cd8a429e] | committer: Luca Barbato

mxf: Fix potential leak in mxf_read_local_tags()

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

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

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index c25fd11..cb383b0 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -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);



More information about the ffmpeg-cvslog mailing list