From 5549aa6d0d695b3563f068cae014a974aa013749 Mon Sep 17 00:00:00 2001 From: David Conrad Date: Tue, 18 May 2010 21:21:37 +0000 Subject: [PATCH] matroskadec: Free ebml binary buffer on error Based on a Chromium patch Originally committed as revision 23169 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/matroskadec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 9126717df2..1bde1af8c4 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -641,8 +641,10 @@ static int ebml_read_binary(ByteIOContext *pb, int length, EbmlBin *bin) bin->size = length; bin->pos = url_ftell(pb); - if (get_buffer(pb, bin->data, length) != length) + if (get_buffer(pb, bin->data, length) != length) { + av_freep(&bin->data); return AVERROR(EIO); + } return 0; }