[FFmpeg-cvslog] avcodec/qoadec: Fix undefined overflow in lms_predict
Michael Niedermayer
git at videolan.org
Wed Mar 27 00:24:13 EET 2024
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Mar 26 01:58:25 2024 +0100| [7eabe564365f4130c4d8f1d50fd835b45dc46355] | committer: Michael Niedermayer
avcodec/qoadec: Fix undefined overflow in lms_predict
Fixes: signed integer overflow: -1575944192 + -602931200 cannot be represented in type 'int'
Fixes: 62285/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QOA_fuzzer-6470469339185152
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=7eabe564365f4130c4d8f1d50fd835b45dc46355
---
libavcodec/qoadec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/qoadec.c b/libavcodec/qoadec.c
index 75099d1199..c5cf351f9c 100644
--- a/libavcodec/qoadec.c
+++ b/libavcodec/qoadec.c
@@ -67,7 +67,7 @@ static int qoa_lms_predict(QOAChannel *lms)
{
int prediction = 0;
for (int i = 0; i < QOA_LMS_LEN; i++)
- prediction += lms->weights[i] * lms->history[i];
+ prediction += (unsigned)lms->weights[i] * lms->history[i];
return prediction >> 13;
}
More information about the ffmpeg-cvslog
mailing list