summaryrefslogtreecommitdiff
path: root/libavcodec/h264dec.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/h264dec.c
parentf1214ad5d9ece179955f9326f3e33e0049660134 (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/h264dec.c')
-rw-r--r--libavcodec/h264dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 665d3e46a5..4ecaec267c 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -285,7 +285,7 @@ int ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl)
mb_array_size * sizeof(uint8_t), fail);
FF_ALLOC_OR_GOTO(h->avctx, er->er_temp_buffer,
- h->mb_height * h->mb_stride, fail);
+ h->mb_height * h->mb_stride * (4*sizeof(int) + 1), fail);
FF_ALLOCZ_OR_GOTO(h->avctx, sl->dc_val_base,
yc_size * sizeof(int16_t), fail);