Commit 10add8bb authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/cdgraphics: avoid signed overflow in alpha

Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 42766/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDGRAPHICS_fuzzer-5142826105569280

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 209488cc
......@@ -122,7 +122,7 @@ static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low)
r = ((color >> 8) & 0x000F) * 17;
g = ((color >> 4) & 0x000F) * 17;
b = ((color ) & 0x000F) * 17;
palette[i + array_offset] = cc->alpha[i + array_offset] << 24 | r << 16 | g << 8 | b;
palette[i + array_offset] = (uint32_t)cc->alpha[i + array_offset] << 24 | r << 16 | g << 8 | b;
}
cc->frame->palette_has_changed = 1;
}
......
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