diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-01-12 00:29:02 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-02-25 21:39:17 +0100 |
commit | 81d9c57c431abd267ef21fc51bd6c7178b042b2f (patch) | |
tree | 8e021b96b96f74945b076c1c2c578c1af96866b4 | |
parent | 3ae6feff7ebf7bfbd74c0617ddc8c13adaadfd7b (diff) | |
download | ffmpeg-81d9c57c431abd267ef21fc51bd6c7178b042b2f.tar.gz |
avcodec/videodsp_template: Adjust pointers to avoid undefined pointer things
Fixes: subtraction of unsigned offset from 0xf6602770 overflowed to 0xf6638c80
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-495074400600064
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f0150cd41c2d3c01050a6c4f3df1de511a217913)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/videodsp_template.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/videodsp_template.c b/libavcodec/videodsp_template.c index 324d70f2cb..d653f4d524 100644 --- a/libavcodec/videodsp_template.c +++ b/libavcodec/videodsp_template.c @@ -64,7 +64,7 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, av_assert2(start_x < end_x && block_w); w = end_x - start_x; - src += start_y * src_linesize + start_x * sizeof(pixel); + src += start_y * src_linesize + start_x * (ptrdiff_t)sizeof(pixel); buf += start_x * sizeof(pixel); // top @@ -87,7 +87,7 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, buf += buf_linesize; } - buf -= block_h * buf_linesize + start_x * sizeof(pixel); + buf -= block_h * buf_linesize + start_x * (ptrdiff_t)sizeof(pixel); while (block_h--) { pixel *bufp = (pixel *) buf; |