aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2012-10-24 16:54:25 +0200
committerLuca Barbato <lu_zero@gentoo.org>2014-01-14 18:23:00 +0100
commitcc1e3ace63075ccd75ef3a2acdeb2e81cd8a429e (patch)
tree7dfad2665f0b334d2be2c53c48703a4ce876ae4d
parent8b708f1c6b1baf3b97ed93226bf5dae1a9b13fb7 (diff)
downloadffmpeg-cc1e3ace63075ccd75ef3a2acdeb2e81cd8a429e.tar.gz
mxf: Fix potential leak in mxf_read_local_tags()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavformat/mxfdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index c25fd11520..cb383b0ea2 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);