summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-07-07 17:29:28 -0600
committerBrian Paul <brianp@vmware.com>2011-07-07 19:22:06 -0600
commitd8f65c07e9f3a5948c8bee95482bcab651b33c01 (patch)
tree044618dd19e485f535f4403712ad1cb60679843f
parent7eb7d67d50fccb64248d1fc6f490895048d7d32e (diff)
downloadexternal_mesa3d-d8f65c07e9f3a5948c8bee95482bcab651b33c01.zip
external_mesa3d-d8f65c07e9f3a5948c8bee95482bcab651b33c01.tar.gz
external_mesa3d-d8f65c07e9f3a5948c8bee95482bcab651b33c01.tar.bz2
intel: add null src pointer check in intel_region_reference()
Fixes segfault when running cubemap demo on i945. This happened when intel_region_reference() was called in i915_set_draw_region() with depth_region=NULL. Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 6cf37c4..4c4945c 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -271,7 +271,8 @@ intel_region_reference(struct intel_region **dst, struct intel_region *src)
if (*dst)
intel_region_release(dst);
- src->refcount++;
+ if (src)
+ src->refcount++;
*dst = src;
}
}