aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-01-17 14:16:39 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-03-28 23:18:55 +0200
commitf1ae88029830e64d348a7ae86a5f12babe0afcb4 (patch)
tree74a1f62d5500538fbd87d2710f7f283af3b9a5bd
parent911d7f167c30f27a042b8558dfcf012b3c20e858 (diff)
downloadffmpeg-f1ae88029830e64d348a7ae86a5f12babe0afcb4.tar.gz
avcodec/cfhd: Avoid signed integer overflow in coeff
Fixes: signed integer overflow: 15244032 * 256 cannot be represented in type 'int' Fixes: 43504/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4865014842916864 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 cd6ac013a00373126bf3d313743d39b5edd5428a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/cfhd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 008a6360b6..ac7826250f 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -838,7 +838,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
const uint16_t q = s->quantisation;
for (i = 0; i < run; i++) {
- *coeff_data |= coeff * 256;
+ *coeff_data |= coeff * 256U;
*coeff_data++ *= q;
}
} else {
@@ -869,7 +869,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
const uint16_t q = s->quantisation;
for (i = 0; i < run; i++) {
- *coeff_data |= coeff * 256;
+ *coeff_data |= coeff * 256U;
*coeff_data++ *= q;
}
} else {