diff options
author | Gabriel Forté <gforte@wyplay.com> | 2007-12-29 18:30:27 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2007-12-29 18:30:27 +0000 |
commit | b3d8c2c4368d64af4564961bd57465f54e1fcaad (patch) | |
tree | 2def346ff9868dc8d965a77e4a55abef32e71648 | |
parent | 5cc9253f35c8bce78cd36ce21296b49ca94c165e (diff) | |
download | ffmpeg-b3d8c2c4368d64af4564961bd57465f54e1fcaad.tar.gz |
fix memory leak (patch by Gabriel Forté gforte _at_ wyplay _dot_ com)
Originally committed as revision 11349 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/matroskadec.c | 8 |
1 files 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; } |