diff mbox

[FFmpeg-devel,2/4] avcodec/alac: Fix integer overflow in LPC coefficient adaption

Message ID 20191207232012.29634-2-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer Dec. 7, 2019, 11:20 p.m. UTC
Fixes: signed integer overflow: 267693597 * 10 cannot be represented in type 'int'
Fixes: 19237/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5755407700328448

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

Comments

Michael Niedermayer Jan. 11, 2020, 10:40 p.m. UTC | #1
On Sun, Dec 08, 2019 at 12:20:10AM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 267693597 * 10 cannot be represented in type 'int'
> Fixes: 19237/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5755407700328448
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/alac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply


[...]
diff mbox

Patch

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index d08c946249..ea5ab182f9 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -228,7 +228,7 @@  static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out,
                 sign = sign_only(val) * error_sign;
                 lpc_coefs[j] -= sign;
                 val *= (unsigned)sign;
-                error_val -= (val >> lpc_quant) * (j + 1);
+                error_val -= (val >> lpc_quant) * (j + 1U);
             }
         }
     }