diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-06-15 00:47:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-11 20:18:46 +0100 |
commit | 768c8c6852ccbf19de99b485d9af9717a8d5fec8 (patch) | |
tree | c4f7932b93a99b11ef29383a2012e45926c96acc /libavcodec/videodsp_template.c | |
parent | 9b5de41bab4bd5e5711e785d7c7d3b15f2928e86 (diff) | |
download | ffmpeg-768c8c6852ccbf19de99b485d9af9717a8d5fec8.tar.gz |
avcodec/videodsp_template: Fix overflow of addition
Fixes: addition of unsigned offset to 0x7f56fc26a9b6 overflowed to 0x7f56fc26a8be*
Fixes: clusterfuzz-testcase-minimized-mediasource_MP4_AVC1_pipeline_integration_fuzzer-4917949056679936
Reported-by: Matt Wolenetz <wolenetz@google.com>
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 247a1de7f7d9c5628cf188e677d10ce9e12bd2f2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/videodsp_template.c')
-rw-r--r-- | libavcodec/videodsp_template.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/videodsp_template.c b/libavcodec/videodsp_template.c index 94c1b7188d..55123a5844 100644 --- a/libavcodec/videodsp_template.c +++ b/libavcodec/videodsp_template.c @@ -44,7 +44,8 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, src_y = 1 - block_h; } if (src_x >= w) { - src += (w - 1 - src_x) * sizeof(pixel); + // The subtracted expression has an unsigned type and must thus not be negative + src -= (1 + src_x - w) * sizeof(pixel); src_x = w - 1; } else if (src_x <= -block_w) { src += (1 - block_w - src_x) * sizeof(pixel); |