Gerald Pfeifer : d3d8: Adjust D3DCOLOR_ARGB to avoid shift overflow.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 20 11:28:30 CDT 2015


Module: wine
Branch: master
Commit: ef837a9c6f1272c58116d24a0460a8bace6c3e41
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ef837a9c6f1272c58116d24a0460a8bace6c3e41

Author: Gerald Pfeifer <gerald at pfeifer.com>
Date:   Mon Oct 19 22:05:10 2015 +0200

d3d8: Adjust D3DCOLOR_ARGB to avoid shift overflow.

Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/d3d8types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/d3d8types.h b/include/d3d8types.h
index 9592544..3506805 100644
--- a/include/d3d8types.h
+++ b/include/d3d8types.h
@@ -38,7 +38,7 @@
 #define D3DCLIPPLANE4 (1 << 4)
 #define D3DCLIPPLANE5 (1 << 5)
 
-#define D3DCOLOR_ARGB(a,r,g,b)        ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
+#define D3DCOLOR_ARGB(a,r,g,b)        ((D3DCOLOR)((((a)&0xffu)<<24)|(((r)&0xffu)<<16)|(((g)&0xffu)<<8)|((b)&0xffu)))
 #define D3DCOLOR_COLORVALUE(r,g,b,a)  D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
 #define D3DCOLOR_RGBA(r,g,b,a)        D3DCOLOR_ARGB(a,r,g,b)
 #define D3DCOLOR_XRGB(r,g,b)          D3DCOLOR_ARGB(0xff,r,g,b)




More information about the wine-cvs mailing list