summaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg_er.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-01-22 21:14:05 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-01-22 21:39:43 +0100
commitd9d9fd9446eb722fd288f56d905f0dfde661af8f (patch)
tree6bd74f75d38e84bd24bdf2902f93938c361c2ae2 /libavcodec/mpeg_er.c
parentf1214ad5d9ece179955f9326f3e33e0049660134 (diff)
downloadffmpeg-streaming-d9d9fd9446eb722fd288f56d905f0dfde661af8f.zip
ffmpeg-streaming-d9d9fd9446eb722fd288f56d905f0dfde661af8f.tar.gz
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpeg_er.c b/libavcodec/mpeg_er.c
index dd87ae9..ee8b2a5 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;
OpenPOWER on IntegriCloud