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>
pull/388/head
Michael Niedermayer 2 years ago
parent 8ab944c4c3
commit 7086491fa0
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      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);

Loading…
Cancel
Save