diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-06-24 02:50:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-07-07 12:09:34 +0200 |
commit | 115b7c96e9e8823e5c8a8bc2137be8e2038befcd (patch) | |
tree | 9e520f31ad25778363a79add2b090955d3fd379c /libavcodec | |
parent | bcc0ae5d5a3841a743f3990e5cfc2e56cad185ff (diff) | |
download | ffmpeg-115b7c96e9e8823e5c8a8bc2137be8e2038befcd.tar.gz |
libavcodec/vp8: Do not compute line pointers per pixel in fade()
72->60 seconds
Testcase: 8680/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP7_fuzzer-5861504418054144
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vp8.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 62b9f8bc2d..3adfeac3d9 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -492,9 +492,11 @@ static void fade(uint8_t *dst, ptrdiff_t dst_linesize, { int i, j; for (j = 0; j < height; j++) { + const uint8_t *src2 = src + j * src_linesize; + uint8_t *dst2 = dst + j * dst_linesize; for (i = 0; i < width; i++) { - uint8_t y = src[j * src_linesize + i]; - dst[j * dst_linesize + i] = av_clip_uint8(y + ((y * beta) >> 8) + alpha); + uint8_t y = src2[i]; + dst2[i] = av_clip_uint8(y + ((y * beta) >> 8) + alpha); } } } |