Commit 7334985f authored by Michael Niedermayer's avatar Michael Niedermayer

libavcodec/cfhd: Fix signed overflow in shift

Fixes: 8695/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4906172426485760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5d8df3cc
...@@ -541,7 +541,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -541,7 +541,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
s->peak.level = 0; s->peak.level = 0;
} else if (tag == -76) { } else if (tag == -76) {
s->peak.offset &= 0xffff; s->peak.offset &= 0xffff;
s->peak.offset |= (data & 0xffff)<<16; s->peak.offset |= (data & 0xffffU)<<16;
s->peak.base = (int16_t *) gb.buffer; s->peak.base = (int16_t *) gb.buffer;
s->peak.level = 0; s->peak.level = 0;
} else if (tag == -74 && s->peak.offset) { } else if (tag == -74 && s->peak.offset) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment