[FFmpeg-cvslog] avcodec/ralf: Fix integer overflow in apply_lpc()
Michael Niedermayer
git at videolan.org
Fri Apr 24 02:13:39 EEST 2020
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Dec 8 13:48:45 2019 +0100| [cd9734b52e78f97a0f126dd5ae05635eb65edc6b] | committer: Michael Niedermayer
avcodec/ralf: Fix integer overflow in apply_lpc()
Fixes: signed integer overflow: 2147482897 + 2048 cannot be represented in type 'int'
Fixes: 19240/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5743240326414336
Fixes: 19869/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5150136636538880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit fd313d8cf8368918882b6de0880e44ae25cc7394)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd9734b52e78f97a0f126dd5ae05635eb65edc6b
---
libavcodec/ralf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c
index 8bac5a22b0..7f81901d8f 100644
--- a/libavcodec/ralf.c
+++ b/libavcodec/ralf.c
@@ -330,7 +330,7 @@ static void apply_lpc(RALFContext *ctx, int ch, int length, int bits)
acc = (acc + bias - 1) >> ctx->filter_bits;
acc = FFMAX(acc, min_clip);
} else {
- acc = (acc + bias) >> ctx->filter_bits;
+ acc = ((unsigned)acc + bias) >> ctx->filter_bits;
acc = FFMIN(acc, max_clip);
}
audio[i] += acc;
More information about the ffmpeg-cvslog
mailing list