summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Forté <gforte@wyplay.com>2007-12-29 18:30:27 +0000
committerAurelien Jacobs <aurel@gnuage.org>2007-12-29 18:30:27 +0000
commitb3d8c2c4368d64af4564961bd57465f54e1fcaad (patch)
tree2def346ff9868dc8d965a77e4a55abef32e71648
parent5cc9253f35c8bce78cd36ce21296b49ca94c165e (diff)
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.c8
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;
}