aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-08-14 23:30:22 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-08-23 20:03:03 +0200
commit7086491fa0eca4ad647b5c9fae6d07344cc44ec0 (patch)
treecf00aa262d87ea7dc979def639f6fc615fc0e66f
parent8ab944c4c33e7bc2d5c0ebb62a57099817b350c2 (diff)
downloadffmpeg-7086491fa0eca4ad647b5c9fae6d07344cc44ec0.tar.gz
avcodec/mpegaudiodec_template: use unsigned shift in handle_crc()
Fixes: left shift of 192 by 24 places cannot be represented in type 'int' Fixes: 49577/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP1FLOAT_fuzzer-5205996678545408 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mpegaudiodec_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index a28cac9867..a711154a3c 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -374,7 +374,7 @@ static int handle_crc(MPADecodeContext *s, int sec_len)
crc_val = av_crc(crc_tab, crc_val, &buf[6], sec_byte_len);
AV_WB32(tmp_buf,
- ((buf[6 + sec_byte_len] & (0xFF00 >> sec_rem_bits)) << 24) +
+ ((buf[6 + sec_byte_len] & (0xFF00U >> sec_rem_bits)) << 24) +
((s->crc << 16) >> sec_rem_bits));
crc_val = av_crc(crc_tab, crc_val, tmp_buf, 3);