[FFmpeg-cvslog] avcodec/alac: Fix integer overflow in lpc_prediction() with sign
Michael Niedermayer
git at videolan.org
Sun Dec 1 18:19:58 EET 2019
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Nov 8 20:40:46 2019 +0100| [7686ba1f149a94c3bac235589de8aa8db92be4e5] | committer: Michael Niedermayer
avcodec/alac: Fix integer overflow in lpc_prediction() with sign
Fixes: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int'
Fixes: 18643/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5672182449700864
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7686ba1f149a94c3bac235589de8aa8db92be4e5
---
libavcodec/alac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 09decb806b..d08c946249 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -227,7 +227,7 @@ static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out,
val = d - pred[j];
sign = sign_only(val) * error_sign;
lpc_coefs[j] -= sign;
- val *= sign;
+ val *= (unsigned)sign;
error_val -= (val >> lpc_quant) * (j + 1);
}
}
More information about the ffmpeg-cvslog
mailing list