[FFmpeg-cvslog] texturedsp: Explicitly cast RGBA parameters to unsigned

Vittorio Giovara git at videolan.org
Sun Nov 29 16:08:27 CET 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Mon Nov 23 17:02:19 2015 -0500| [fdd5c48ebdec489ec9e84eee547fefa50c3ad53c] | committer: Vittorio Giovara

texturedsp: Explicitly cast RGBA parameters to unsigned

Silences warnings when using -Wshift-overflow (GCC 6+).
Found-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fdd5c48ebdec489ec9e84eee547fefa50c3ad53c
---

 libavcodec/texturedsp.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/texturedsp.c b/libavcodec/texturedsp.c
index 78eb6fa..58446b1 100644
--- a/libavcodec/texturedsp.c
+++ b/libavcodec/texturedsp.c
@@ -31,7 +31,10 @@
 
 #include "texturedsp.h"
 
-#define RGBA(r, g, b, a) (r) | ((g) << 8) | ((b) << 16) | ((a) << 24)
+#define RGBA(r, g, b, a) ((uint8_t)(r) <<  0) | \
+                         ((uint8_t)(g) <<  8) | \
+                         ((uint8_t)(b) << 16) | \
+                         ((uint8_t)(a) << 24)
 
 static av_always_inline void extract_color(uint32_t colors[4],
                                            uint16_t color0,



More information about the ffmpeg-cvslog mailing list