[FFmpeg-cvslog] avformat/matroskadec: Fix OOM on long streams

Michael Niedermayer git at videolan.org
Tue Dec 27 03:48:38 EET 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Dec 26 03:16:01 2016 +0100| [b347ca93412f43fb4593e1381b3b22e2fa20c0de] | committer: Michael Niedermayer

avformat/matroskadec: Fix OOM on long streams

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b347ca93412f43fb4593e1381b3b22e2fa20c0de
---

 libavformat/matroskadec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 58731aa..7e74348 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 &&



More information about the ffmpeg-cvslog mailing list