Index: /trunk/src/VBox/Devices/Graphics/shaderlib/glsl_shader.c
===================================================================
--- /trunk/src/VBox/Devices/Graphics/shaderlib/glsl_shader.c	(revision 82699)
+++ /trunk/src/VBox/Devices/Graphics/shaderlib/glsl_shader.c	(revision 82700)
@@ -3202,4 +3202,6 @@
     if (shader_version < WINED3D_SHADER_VERSION(2,0)) sampler_idx = ins->dst[0].reg.idx;
     else sampler_idx = ins->src[1].reg.idx;
+
+    AssertReturnVoid(sampler_idx < RT_ELEMENTS(ins->ctx->reg_maps->sampler_type));
     sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx];
 
@@ -3297,4 +3299,6 @@
 
     sampler_idx = ins->src[1].reg.idx;
+    AssertReturnVoid(sampler_idx < RT_ELEMENTS(ins->ctx->reg_maps->sampler_type));
+
     sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx];
     if(deviceImpl->stateBlock->textures[sampler_idx] &&
@@ -3325,4 +3329,6 @@
 
     sampler_idx = ins->src[1].reg.idx;
+    AssertReturnVoid(sampler_idx < RT_ELEMENTS(ins->ctx->reg_maps->sampler_type));
+
     sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx];
     if(deviceImpl->stateBlock->textures[sampler_idx] &&
