avcodec/error_resilience: Optimize motion recovery code by using blcok lists
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 22 Jan 2017 20:14:05 +0000 (21:14 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 22 Jan 2017 20:39:43 +0000 (21:39 +0100)
commitd9d9fd9446eb722fd288f56d905f0dfde661af8f
tree6bd74f75d38e84bd24bdf2902f93938c361c2ae2
parentf1214ad5d9ece179955f9326f3e33e0049660134
avcodec/error_resilience: Optimize motion recovery code by using blcok lists

This makes the code 7 times faster with the testcase from libfuzzer
and should reduce the amount of timeouts we hit in automated fuzzing.
(for example 438/fuzz-2-ffmpeg_VIDEO_AV_CODEC_ID_RV40_fuzzer)

The code is also faster with more realistic input though the difference
is small here as that is far from the worst cases the fuzzers pick out

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/error_resilience.c
libavcodec/h264dec.c
libavcodec/mpeg_er.c