summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r--src/mesa/main/texstate.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 1fd09e98538..0e5ba44ed49 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -600,6 +600,13 @@ update_texture_state( struct gl_context *ctx )
texTarget = (gl_texture_index) (ffs(enabledTargets) - 1);
texObj = _mesa_get_fallback_texture(ctx, texTarget);
+
+ assert(texObj);
+ if (!texObj) {
+ /* invalid fallback texture: don't enable the texture unit */
+ continue;
+ }
+
_mesa_reference_texobj(&texUnit->_Current, texObj);
texUnit->_ReallyEnabled = 1 << texTarget;
}