[FFmpeg-cvslog] flv: Skip invalid index

Michael Niedermayer git at videolan.org
Tue Nov 8 17:46:30 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov  8 17:11:02 2011 +0100| [4b7ef5a1e6fa622fc85741c9c1ca11c798cda9cb] | committer: Michael Niedermayer

flv: Skip invalid index

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/flvdec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index e2f7f9c..954deeb 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



More information about the ffmpeg-cvslog mailing list