draw: check for null sampler pointers
authorBrian Paul <brianp@vmware.com>
Thu, 30 Sep 2010 22:41:31 +0000 (16:41 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 30 Sep 2010 22:42:17 +0000 (16:42 -0600)
http://bugs.freedesktop.org/show_bug.cgi?id=30516

src/gallium/auxiliary/draw/draw_llvm.c

index 4749bb57a53174e68bc836459c4378166e2c6f52..7fb86d7cb275f5f5c5bfe7ffa56658f1fc76e98c 100644 (file)
@@ -1099,10 +1099,12 @@ draw_llvm_set_sampler_state(struct draw_context *draw)
    for (i = 0; i < draw->num_samplers; i++) {
       struct draw_jit_texture *jit_tex = &draw->llvm->jit_context.textures[i];
 
-      jit_tex->min_lod = draw->samplers[i]->min_lod;
-      jit_tex->max_lod = draw->samplers[i]->max_lod;
-      jit_tex->lod_bias = draw->samplers[i]->lod_bias;
-      COPY_4V(jit_tex->border_color, draw->samplers[i]->border_color);
+      if (draw->samplers[i]) {
+         jit_tex->min_lod = draw->samplers[i]->min_lod;
+         jit_tex->max_lod = draw->samplers[i]->max_lod;
+         jit_tex->lod_bias = draw->samplers[i]->lod_bias;
+         COPY_4V(jit_tex->border_color, draw->samplers[i]->border_color);
+      }
    }
 }