diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-26 03:16:01 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-27 02:48:19 +0100 |
commit | b347ca93412f43fb4593e1381b3b22e2fa20c0de (patch) | |
tree | 37dc6aee319560846c79a89351376939737d46d2 /libavformat/matroskadec.c | |
parent | a7946c8964691a8cac8e8c479d61c9b068d9d76e (diff) | |
download | ffmpeg-b347ca93412f43fb4593e1381b3b22e2fa20c0de.tar.gz |
avformat/matroskadec: Fix OOM on long streams
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 58731aaaba..7e74348b2a 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3234,9 +3234,11 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE && timecode < track->end_timecode) is_keyframe = 0; /* overlapping subtitles are not key frame */ - if (is_keyframe) + if (is_keyframe) { + ff_reduce_index(matroska->ctx, st->index); av_add_index_entry(st, cluster_pos, timecode, 0, 0, AVINDEX_KEYFRAME); + } } if (matroska->skip_to_keyframe && |