From bfbcfd22342c2469b54d64514471f5dfa0bdb02e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Wed, 9 Aug 2006 18:02:28 +0200 Subject: [PATCH] wined3d: Watch out for negative results when validating the shader constant range. --- dlls/wined3d/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e5086994260..9ac8cf9b363 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4833,7 +4833,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShaderConstantI( TRACE("(iface %p, dstData %p, start %d, count %d)\n", iface, dstData, start, count); - if (dstData == NULL || cnt < 0) + if (dstData == NULL || ((signed int) MAX_CONST_I - (signed int) start) <= (signed int) 0) return WINED3DERR_INVALIDCALL; memcpy(dstData, &This->stateBlock->vertexShaderConstantI[start * 4], cnt * sizeof(int) * 4); @@ -4852,7 +4852,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantF( TRACE("(iface %p, srcData %p, start %d, count %d)\n", iface, srcData, start, count); - if (srcData == NULL || cnt < 0) + if (srcData == NULL || ((signed int) GL_LIMITS(vshader_constantsF) - (signed int) start) <= (signed int) 0) return WINED3DERR_INVALIDCALL; memcpy(&This->updateStateBlock->vertexShaderConstantF[start * 4], srcData, cnt * sizeof(float) * 4); -- 2.11.4.GIT