Fix two bounds checks in dlls/ddraw/device.c

Gerald Pfeifer gerald at pfeifer.com
Fri Jun 19 12:07:42 CDT 2009


This is along the lines of what I just submitted five minutes ago.

Gerald


ChangeLog:
Fix two bounds checks.

diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 261d6e3..439e99f 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -2956,7 +2956,7 @@ IDirect3DDeviceImpl_3_SetLightState(IDirect3DDevice3 *iface,
 
     TRACE("(%p)->(%08x,%08x)\n", This, LightStateType, Value);
 
-    if (!LightStateType && (LightStateType > D3DLIGHTSTATE_COLORVERTEX))
+    if (!LightStateType || (LightStateType > D3DLIGHTSTATE_COLORVERTEX))
     {
         TRACE("Unexpected Light State Type\n");
         return DDERR_INVALIDPARAMS;
@@ -3089,7 +3089,7 @@ IDirect3DDeviceImpl_3_GetLightState(IDirect3DDevice3 *iface,
 
     TRACE("(%p)->(%08x,%p)\n", This, LightStateType, Value);
 
-    if (!LightStateType && (LightStateType > D3DLIGHTSTATE_COLORVERTEX))
+    if (!LightStateType || (LightStateType > D3DLIGHTSTATE_COLORVERTEX))
     {
         TRACE("Unexpected Light State Type\n");
         return DDERR_INVALIDPARAMS;



More information about the wine-patches mailing list