Commit 83f70805 authored by Michael Niedermayer's avatar Michael Niedermayer

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

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 67c734ea
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment