diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-23 22:08:37 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-15 12:25:47 +0100 |
commit | f94127a40ef3c20f784b9e073be08e633f347430 (patch) | |
tree | 0872e42759127c79b6d2ba1250dc8a3d3f2e2000 | |
parent | 4b8a0ce8f7934c14bface833def676b866076925 (diff) | |
download | ffmpeg-f94127a40ef3c20f784b9e073be08e633f347430.tar.gz |
avcodec/xsubdec: fix overflow in alpha handling
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 18368/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XSUB_fuzzer-5702665442426880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9ea997395909907f569787d4ba5b96352ad31a80)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/xsubdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index 93fd0f4d50..05c4a64ee5 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -130,7 +130,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, ((uint32_t *)sub->rects[0]->data[1])[i] |= 0xff000000; } else { for (i = 0; i < sub->rects[0]->nb_colors; i++) - ((uint32_t *)sub->rects[0]->data[1])[i] |= *buf++ << 24; + ((uint32_t *)sub->rects[0]->data[1])[i] |= (unsigned)*buf++ << 24; } #if FF_API_AVPICTURE |