Commit ccd2b20a authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ffv1dec_template: Check for the end of input after 1024 pixels

Fixes: Timeout
Fixes: 10385/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-5689206987292672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 8f152480
...@@ -50,6 +50,11 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, ...@@ -50,6 +50,11 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w,
for (x = 0; x < w; x++) { for (x = 0; x < w; x++) {
int diff, context, sign; int diff, context, sign;
if (!(x & 1023)) {
if (is_input_end(s))
return AVERROR_INVALIDDATA;
}
context = RENAME(get_context)(p, sample[1] + x, sample[0] + x, sample[1] + x); context = RENAME(get_context)(p, sample[1] + x, sample[0] + x, sample[1] + x);
if (context < 0) { if (context < 0) {
context = -context; context = -context;
......
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