summaryrefslogtreecommitdiff
path: root/libavcodec/apedec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-12-07 20:55:16 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-30 19:58:15 +0100
commita3655bb02c21e70573335e9396632f64b2589536 (patch)
tree98c6c979e3067ca9aa7b34210ebe47c6ac9f2c95 /libavcodec/apedec.c
parent07754f3f8fdac85f4a73f463b3b68f0214dcabda (diff)
avcodec/apedec: Fix undefined integer overflow in decode_array_0000()
Fixes: signed integer overflow: -2143289344 - 6246400 cannot be represented in type 'int' Fixes: 19239/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5173755680915456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/apedec.c')
-rw-r--r--libavcodec/apedec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 1b23e54153..3e39a8e62e 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -615,7 +615,7 @@ static void decode_array_0000(APEContext *ctx, GetBitContext *gb,
return ;
}
out[i] = get_rice_ook(&ctx->gb, rice->k);
- rice->ksum += out[i] - out[i - 64];
+ rice->ksum += out[i] - (unsigned)out[i - 64];
while (rice->ksum < ksummin) {
rice->k--;
ksummin = rice->k ? ksummin >> 1 : 0;