[FFmpeg-devel] [PATCH 3/3] flvdec: Print a warning in all failure cases of parse_keyframes_index()

Michael Niedermayer michaelni at gmx.at
Fri Dec 30 01:38:41 CET 2011


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 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);
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list