From 4b7ef5a1e6fa622fc85741c9c1ca11c798cda9cb Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 8 Nov 2011 17:11:02 +0100 Subject: [PATCH] flv: Skip invalid index Signed-off-by: Michael Niedermayer --- libavformat/flvdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index e2f7f9c16d..954deeb583 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -196,7 +196,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream } } - if (timeslen == fileposlen) { + if (timeslen == fileposlen && fileposlen && max_pos <= filepositions[0]) { for(i = 0; i < timeslen; i++) av_add_index_entry(vstream, filepositions[i], times[i]*1000, 0, 0, AVINDEX_KEYFRAME); } else