aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-05 18:22:51 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-06-14 22:02:34 +0200
commit611fc7244a1a93b4d0fd652d13a09c52f2dc19f3 (patch)
treea439802dd98efd732b161d7d6fe8b42cc4901802
parent8dee726b1a5c82c5e6578a606b299c6fdc74c142 (diff)
downloadffmpeg-611fc7244a1a93b4d0fd652d13a09c52f2dc19f3.tar.gz
avcodec/movtextdec: Fix shift overflows in mov_text_init()
Fixes: left shift of 243 by 24 places cannot be represented in type 'int' Fixes: 22716/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOVTEXT_fuzzer-5704263425851392 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 d7a2311a2c5be1e861c3df618d295e7eced8e84b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/movtextdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 4b4da5e0d9..4a21dbf36d 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -492,10 +492,10 @@ static int mov_text_init(AVCodecContext *avctx) {
return ff_ass_subtitle_header_full(avctx,
m->frame_width, m->frame_height,
m->d.font, m->d.fontsize,
- (255 - m->d.alpha) << 24 | RGB_TO_BGR(m->d.color),
- (255 - m->d.alpha) << 24 | RGB_TO_BGR(m->d.color),
- (255 - m->d.back_alpha) << 24 | RGB_TO_BGR(m->d.back_color),
- (255 - m->d.back_alpha) << 24 | RGB_TO_BGR(m->d.back_color),
+ (255U - m->d.alpha) << 24 | RGB_TO_BGR(m->d.color),
+ (255U - m->d.alpha) << 24 | RGB_TO_BGR(m->d.color),
+ (255U - m->d.back_alpha) << 24 | RGB_TO_BGR(m->d.back_color),
+ (255U - m->d.back_alpha) << 24 | RGB_TO_BGR(m->d.back_color),
m->d.bold, m->d.italic, m->d.underline,
ASS_DEFAULT_BORDERSTYLE, m->d.alignment);
} else