From: Michael Niedermayer Date: Thu, 29 Dec 2011 22:24:10 +0000 (+0100) Subject: flvdec: Print a warning in all failure cases of parse_keyframes_index() X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=83f70805c04ec53e7f18159fd04a20f40e1818c8;p=ffmpeg flvdec: Print a warning in all failure cases of parse_keyframes_index() Signed-off-by: Michael Niedermayer --- diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 203ea9f2551..5aed3eda763 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(×);