Commit 9ea99739 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 32b3c8ce
...@@ -130,7 +130,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, ...@@ -130,7 +130,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
((uint32_t *)sub->rects[0]->data[1])[i] |= 0xff000000; ((uint32_t *)sub->rects[0]->data[1])[i] |= 0xff000000;
} else { } else {
for (i = 0; i < sub->rects[0]->nb_colors; i++) 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 #if FF_API_AVPICTURE
......
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