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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user