aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-17 05:00:13 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:58 +0100
commit78ac14f280f9bf71c824ef11c40f0a0f3c877b4c (patch)
treece9b549459e0fbaa29aaff850c7813c6cd54f734
parent915e68c051952f4bc18b8d0fa35a7870cb3dd803 (diff)
downloadffmpeg-78ac14f280f9bf71c824ef11c40f0a0f3c877b4c.tar.gz
avcodec/movtextenc: Fix undefined left shifts outside the range of int
Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit 2f9fc35028364b0140fd6e0d2e4dbaffebed1acd)
-rw-r--r--libavcodec/movtextenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index e6af958738..ccf404816c 100644
--- a/libavcodec/movtextenc.c
+++ b/libavcodec/movtextenc.c
@@ -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)