diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-01-22 23:14:05 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-01-22 23:39:43 +0300 |
commit | d9d9fd9446eb722fd288f56d905f0dfde661af8f (patch) | |
tree | 6bd74f75d38e84bd24bdf2902f93938c361c2ae2 /libavcodec/mpeg_er.c | |
parent | f1214ad5d9ece179955f9326f3e33e0049660134 (diff) |
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>
Diffstat (limited to 'libavcodec/mpeg_er.c')
-rw-r--r-- | libavcodec/mpeg_er.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpeg_er.c b/libavcodec/mpeg_er.c index dd87ae9cc9..ee8b2a5e7b 100644 --- a/libavcodec/mpeg_er.c +++ b/libavcodec/mpeg_er.c @@ -109,7 +109,7 @@ int ff_mpeg_er_init(MpegEncContext *s) er->mb_stride = s->mb_stride; er->b8_stride = s->b8_stride; - er->er_temp_buffer = av_malloc(s->mb_height * s->mb_stride); + er->er_temp_buffer = av_malloc(s->mb_height * s->mb_stride * (4*sizeof(int) + 1)); er->error_status_table = av_mallocz(mb_array_size); if (!er->er_temp_buffer || !er->error_status_table) goto fail; |