diff mbox series

[FFmpeg-devel,6/7] avcodec/ttadsp: Fix several integer overflows in tta_filter_process_c()

Message ID 20200510192019.14218-6-michael@niedermayer.cc
State Accepted
Commit 8627885172cc54db95f86529d134308d4d095054
Headers show
Series [FFmpeg-devel,1/7] avcodec/mpc: Fix multiple numerical overflows in ff_mpc_dequantize_and_synth()
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate fail Make fate failed

Commit Message

Michael Niedermayer May 10, 2020, 7:20 p.m. UTC
Fixes: signed integer overflow: 1931744255 + 252497024 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5763348114440192

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

Comments

Michael Niedermayer May 11, 2020, 10:59 p.m. UTC | #1
On Sun, May 10, 2020 at 09:20:18PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 1931744255 + 252497024 cannot be represented in type 'int'
> Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5763348114440192
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/ttadsp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/ttadsp.c b/libavcodec/ttadsp.c
index 056a2c7ef1..1d1443aee0 100644
--- a/libavcodec/ttadsp.c
+++ b/libavcodec/ttadsp.c
@@ -20,9 +20,11 @@ 
 #include "ttadsp.h"
 #include "config.h"
 
-static void tta_filter_process_c(int32_t *qm, int32_t *dx, int32_t *dl,
+static void tta_filter_process_c(int32_t *qmi, int32_t *dx, int32_t *dl,
                                  int32_t *error, int32_t *in, int32_t shift,
                                  int32_t round) {
+    uint32_t *qm = qmi;
+
     if (*error < 0) {
         qm[0] -= dx[0]; qm[1] -= dx[1]; qm[2] -= dx[2]; qm[3] -= dx[3];
         qm[4] -= dx[4]; qm[5] -= dx[5]; qm[6] -= dx[6]; qm[7] -= dx[7];