diff mbox

[FFmpeg-devel,1/2] avcodec/dcadsp: Fix runtime error: signed integer overflow

Message ID 20170407212912.6203-1-michael@niedermayer.cc
State Accepted
Commit 9244b839b788e4677019041907ff5a4378a23490
Headers show

Commit Message

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

Comments

Michael Niedermayer April 9, 2017, 1:48 a.m. UTC | #1
On Fri, Apr 07, 2017 at 11:29:11PM +0200, Michael Niedermayer wrote:
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/dcadsp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

patchset applied

[...]
diff mbox

Patch

diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c
index 4f1e933cfb..fade1a6c02 100644
--- a/libavcodec/dcadsp.c
+++ b/libavcodec/dcadsp.c
@@ -320,7 +320,7 @@  static void dmix_sub_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_add_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)