]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/movtextenc: Fix undefined left shifts outside the range of int
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 17 Oct 2020 03:00:13 +0000 (05:00 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 19 Oct 2020 19:40:28 +0000 (21:40 +0200)
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/movtextenc.c

index 73d998d0802ffb4f820568ed693d2dbffecbebc1..42fdf98042a459fd396e2a02115404c98d8aeefa 100644 (file)
@@ -45,7 +45,7 @@
 #define DEFAULT_STYLE_COLOR    0xffffffff
 #define DEFAULT_STYLE_FLAG     0x00
 
-#define BGR_TO_RGB(c) (((c) & 0xff) << 16 | ((c) & 0xff00) | (((c) >> 16) & 0xff))
+#define BGR_TO_RGB(c) (((c) & 0xff) << 16 | ((c) & 0xff00) | (((uint32_t)(c) >> 16) & 0xff))
 #define FONTSIZE_SCALE(s,fs) ((fs) * (s)->font_scale_factor + 0.5)
 #define av_bprint_append_any(buf, data, size)   av_bprint_append_data(buf, ((const char*)data), size)