summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-08-05 08:34:09 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-08-05 08:38:55 +0100
commit85cfe321805264686ef8989e45a911a999ed928a (patch)
tree96f5ebb314c7325077d18c636eace2e9f41625d8 /src
parent9c98e9e6b5b5f5508b67b3650dbaf00db407b5eb (diff)
intel: Check for region allocation failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index fe4de18960..680d18ba29 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -155,6 +155,9 @@ intel_region_alloc_internal(struct intel_context *intel,
}
region = calloc(sizeof(*region), 1);
+ if (region == NULL)
+ return region;
+
region->cpp = cpp;
region->width = width;
region->height = height;
@@ -189,6 +192,9 @@ intel_region_alloc(struct intel_context *intel,
region = intel_region_alloc_internal(intel, cpp, width, height,
aligned_pitch / cpp, buffer);
+ if (region == NULL)
+ return region;
+
region->tiling = tiling;
return region;