Mesa (master): softpipe: added some null pointer checks

Brian Paul brianp at kemper.freedesktop.org
Tue Jan 18 16:59:51 UTC 2011


Module: Mesa
Branch: master
Commit: 5b58b8c579f06edc2e5ead011e2544eadfbfb77a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b58b8c579f06edc2e5ead011e2544eadfbfb77a

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Jan 18 09:58:55 2011 -0700

softpipe: added some null pointer checks

This shouldn't really be needed but it may help with
http://bugs.freedesktop.org/show_bug.cgi?id=32309

---

 src/gallium/drivers/softpipe/sp_state_derived.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c
index f65bf9a..f9590eb 100644
--- a/src/gallium/drivers/softpipe/sp_state_derived.c
+++ b/src/gallium/drivers/softpipe/sp_state_derived.c
@@ -201,7 +201,7 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
 
    for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
       struct softpipe_tex_tile_cache *tc = softpipe->fragment_tex_cache[i];
-      if (tc->texture) {
+      if (tc && tc->texture) {
          struct softpipe_resource *spt = softpipe_resource(tc->texture);
          if (spt->timestamp != tc->timestamp) {
 	    sp_tex_tile_cache_validate_texture( tc );
@@ -216,7 +216,7 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
    for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
       struct softpipe_tex_tile_cache *tc = softpipe->vertex_tex_cache[i];
 
-      if (tc->texture) {
+      if (tc && tc->texture) {
          struct softpipe_resource *spt = softpipe_resource(tc->texture);
 
          if (spt->timestamp != tc->timestamp) {
@@ -229,7 +229,7 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
    for (i = 0; i < PIPE_MAX_GEOMETRY_SAMPLERS; i++) {
       struct softpipe_tex_tile_cache *tc = softpipe->geometry_tex_cache[i];
 
-      if (tc->texture) {
+      if (tc && tc->texture) {
          struct softpipe_resource *spt = softpipe_resource(tc->texture);
 
          if (spt->timestamp != tc->timestamp) {




More information about the mesa-commit mailing list