[PATCH 1/5] wined3d: Don't use a start index higher than MAX_COMBINED_SAMPLERS - 1 in device_map_vsamplers().

Henri Verbeet hverbeet at codeweavers.com
Mon Aug 17 02:39:05 CDT 2009


---
 dlls/wined3d/device.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c9e50d1..92d6ffd 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3769,7 +3769,7 @@ static void device_map_vsamplers(IWineD3DDeviceImpl *This, BOOL ps) {
     const WINED3DSAMPLER_TEXTURE_TYPE *vshader_sampler_type =
             ((IWineD3DVertexShaderImpl *)This->stateBlock->vertexShader)->baseShader.reg_maps.sampler_type;
     const WINED3DSAMPLER_TEXTURE_TYPE *pshader_sampler_type = NULL;
-    int start = GL_LIMITS(combined_samplers) - 1;
+    int start = min(MAX_COMBINED_SAMPLERS, GL_LIMITS(combined_samplers)) - 1;
     int i;
 
     if (ps) {
-- 
1.6.0.6




More information about the wine-patches mailing list