[FFmpeg-cvslog] avcodec/apedec: fix integer overflow in 8bit samples
Michael Niedermayer
git at videolan.org
Wed Apr 6 21:33:18 EEST 2022
ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Thu Dec 23 20:39:14 2021 +0100| [6c5e26821e075e55fa398cf8a52f833cc1316148] | committer: Michael Niedermayer
avcodec/apedec: fix integer overflow in 8bit samples
Fixes: signed integer overflow: 2147483542 + 128 cannot be represented in type 'int'
Fixes: 42812/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6344057861832704
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 7cee3b37187dbf61dbebff023f07ceedfc0129bb)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6c5e26821e075e55fa398cf8a52f833cc1316148
---
libavcodec/apedec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 0fb3b04db5..e2885891a8 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1587,7 +1587,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
for (ch = 0; ch < s->channels; ch++) {
sample8 = (uint8_t *)frame->data[ch];
for (i = 0; i < blockstodecode; i++)
- *sample8++ = (s->decoded[ch][i] + 0x80) & 0xff;
+ *sample8++ = (s->decoded[ch][i] + 0x80U) & 0xff;
}
break;
case 16:
More information about the ffmpeg-cvslog
mailing list