diff mbox series

[FFmpeg-devel,1/3] avcodec/dcadsp: Fix integer overflow in dmix_add_c()

Message ID 20210130192826.11370-1-michael@niedermayer.cc
State Accepted
Commit b4ebf483bcbf2e5db6bd29607142741f62598b4e
Headers show
Series [FFmpeg-devel,1/3] avcodec/dcadsp: Fix integer overflow in dmix_add_c()
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Jan. 30, 2021, 7:28 p.m. UTC
Fixes: signed integer overflow: 1515225320 + 759416059 cannot be represented in type 'int'
Fixes: 29256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DCA_fuzzer-5719088561258496

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/dcadsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer March 8, 2021, 8:56 p.m. UTC | #1
On Sat, Jan 30, 2021 at 08:28:24PM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 1515225320 + 759416059 cannot be represented in type 'int'
> Fixes: 29256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DCA_fuzzer-5719088561258496
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/dcadsp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c
index faf244c8ad..9d00ebd281 100644
--- a/libavcodec/dcadsp.c
+++ b/libavcodec/dcadsp.c
@@ -329,7 +329,7 @@  static void dmix_add_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t le
     int i;
 
     for (i = 0; i < len; i++)
-        dst[i] += mul15(src[i], coeff);
+        dst[i] += (unsigned)mul15(src[i], coeff);
 }
 
 static void dmix_scale_c(int32_t *dst, int scale, ptrdiff_t len)