[FFmpeg-cvslog] flvdec: Print a warning in all failure cases of parse_keyframes_index()

Michael Niedermayer git at videolan.org
Fri Dec 30 04:38:06 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Dec 29 23:24:10 2011 +0100| [83f70805c04ec53e7f18159fd04a20f40e1818c8] | committer: Michael Niedermayer

flvdec: Print a warning in all failure cases of parse_keyframes_index()

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

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

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

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 203ea9f..5aed3ed 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -177,7 +177,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream
 
         for (i = 0; i < arraylen && avio_tell(ioc) < max_pos - 1; i++) {
             if (avio_r8(ioc) != AMF_DATA_TYPE_NUMBER)
-                goto finish;
+                goto invalid;
             current_array[0][i] = av_int2double(avio_rb64(ioc));
         }
         if (times && filepositions) {
@@ -197,11 +197,13 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream
         dts   = avio_rb24(ioc);
         dts  |= avio_r8(ioc) << 24;
         if (size0 > filepositions[1] || FFABS(dts - times[1]*1000)>5000)
-            goto finish;
+            goto invalid;
          for(i = 0; i < timeslen; i++)
              av_add_index_entry(vstream, filepositions[i], times[i]*1000, 0, 0, AVINDEX_KEYFRAME);
-    } else
+    } else {
+invalid:
         av_log(s, AV_LOG_WARNING, "Invalid keyframes object, skipping.\n");
+    }
 
 finish:
     av_freep(&times);



More information about the ffmpeg-cvslog mailing list