From b65570808cb3b518f969f9288fe643bca6361b8f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 11 Dec 2012 14:43:47 +0100 Subject: [PATCH] mxfdec: fix leak of extradata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Tomas Härdin Signed-off-by: Michael Niedermayer --- libavformat/mxfdec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index a1884f1080..1983774396 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -866,6 +866,10 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int default: /* Private uid used by SONY C0023S01.mxf */ if (IS_KLV_KEY(uid, mxf_sony_mpeg4_extradata)) { + if (descriptor->extradata) + av_log(NULL, AV_LOG_WARNING, "Duplicate sony_mpeg4_extradata\n"); + av_free(descriptor->extradata); + descriptor->extradata_size = 0; descriptor->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); if (!descriptor->extradata) return AVERROR(ENOMEM);