[FFmpeg-cvslog] avcodec/cdgraphics: avoid signed overflow in alpha
Michael Niedermayer
git at videolan.org
Sat Dec 25 13:00:13 EET 2021
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Dec 23 20:20:08 2021 +0100| [10add8bb66b7c9d5999aa5b5a37eef3df27e934a] | committer: 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/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=10add8bb66b7c9d5999aa5b5a37eef3df27e934a
---
libavcodec/cdgraphics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index 06f8392094..a83babdf1e 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -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;
}
More information about the ffmpeg-cvslog
mailing list