OSDN Git Service

swrast: Fix crash when sampling from a non-existing texture object
authorNicolai Haehnle <nhaehnle@gmail.com>
Sat, 24 Mar 2007 13:41:59 +0000 (14:41 +0100)
committerNicolai Haehnle <nhaehnle@gmail.com>
Sat, 24 Mar 2007 13:42:49 +0000 (14:42 +0100)
src/mesa/swrast/s_context.c

index 1c9a098..f5f04b0 100644 (file)
@@ -505,9 +505,7 @@ _swrast_update_texture_samplers(GLcontext *ctx)
 
    for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
       const struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current;
-      if (tObj)
-         swrast->TextureSample[u] =
-            _swrast_choose_texture_sample_func(ctx, tObj);
+      swrast->TextureSample[u] = _swrast_choose_texture_sample_func(ctx, tObj);
    }
 }