texturedsp: Explicitly cast RGBA parameters to unsigned
authorVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 23 Nov 2015 22:02:19 +0000 (17:02 -0500)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 24 Nov 2015 14:24:48 +0000 (09:24 -0500)
Silences warnings when using -Wshift-overflow (GCC 6+).
Found-by: James Almer <jamrial@gmail.com>
libavcodec/texturedsp.c

index 78eb6fa0ce9c7c8c636ac9b76e3822cabe8d4212..58446b1e69b9d2f74a84c8c810084e603f733e14 100644 (file)
 
 #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,