diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-08 13:05:13 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-17 11:35:00 +0100 |
commit | efe4aef90fd8d4259aed0a6ffe317b5be6557da9 (patch) | |
tree | db694b4c4894a16257f83b1f6e5e14a48b6dc4ee | |
parent | d15117c996d928669bea33366ba02f57a887a862 (diff) | |
download | ffmpeg-efe4aef90fd8d4259aed0a6ffe317b5be6557da9.tar.gz |
avcodec/ffv1dec_template: Optimize golomb run mode
Fixes: Timeout (34sec -> 12sec)
Fixes: 13398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-5664106709778432
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/ffv1dec_template.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ffv1dec_template.c b/libavcodec/ffv1dec_template.c index 25032feda0..1b7f6c4bf5 100644 --- a/libavcodec/ffv1dec_template.c +++ b/libavcodec/ffv1dec_template.c @@ -86,6 +86,11 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, run_mode = 2; } } + while (run_count > 1 && w-x > 1) { + sample[1][x] = RENAME(predict)(sample[1] + x, sample[0] + x); + x++; + run_count--; + } run_count--; if (run_count < 0) { run_mode = 0; |