aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-12-23 20:39:14 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-06 20:38:05 +0200
commit429eaaf16ee3bbb8d10e8c6e204d03b537adba80 (patch)
tree5c1962905d348075e68ef2b11dbe84c9267113f3
parentc45013d6c5f1007a9e5de0a008bba05b91575886 (diff)
downloadffmpeg-429eaaf16ee3bbb8d10e8c6e204d03b537adba80.tar.gz
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@niedermayer.cc> (cherry picked from commit 7cee3b37187dbf61dbebff023f07ceedfc0129bb) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/apedec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 9d1ad5993f..621db062e6 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1559,7 +1559,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: