1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

fix memory leak (patch by Gabriel Forté gforte _at_ wyplay _dot_ com)

Originally committed as revision 11349 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Gabriel Forté 2007-12-29 18:30:27 +00:00 committed by Aurelien Jacobs
parent 5cc9253f35
commit b3d8c2c436

View File

@ -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;
}