From b3d8c2c4368d64af4564961bd57465f54e1fcaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fort=C3=A9?= Date: Sat, 29 Dec 2007 18:30:27 +0000 Subject: [PATCH] =?UTF-8?q?fix=20memory=20leak=20(patch=20by=20Gabriel=20F?= =?UTF-8?q?ort=C3=A9=20=20gforte=20=5Fat=5F=20wyplay=20=5Fdot=5F=20com)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 11349 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/matroskadec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 51dbddc048..a2be2425ed 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2268,8 +2268,10 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, av_free(origdata); return res; } - if (matroska->tracks[track]->stream_index < 0) + if (matroska->tracks[track]->stream_index < 0) { + av_free(origdata); return res; + } st = matroska->ctx->streams[matroska->tracks[track]->stream_index]; if (st->discard >= AVDISCARD_ALL) { av_free(origdata); @@ -2287,8 +2289,10 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, is_keyframe = flags & 0x80 ? PKT_FLAG_KEY : 0; if (matroska->skip_to_keyframe) { - if (!is_keyframe || st != matroska->skip_to_stream) + if (!is_keyframe || st != matroska->skip_to_stream) { + av_free(origdata); return res; + } matroska->skip_to_keyframe = 0; }