diff options
author | Chris Wilson <[email protected]> | 2010-08-05 08:34:09 +0100 |
---|---|---|
committer | Chris Wilson <[email protected]> | 2010-08-05 08:38:55 +0100 |
commit | 85cfe321805264686ef8989e45a911a999ed928a (patch) | |
tree | 96f5ebb314c7325077d18c636eace2e9f41625d8 /src/mesa | |
parent | 9c98e9e6b5b5f5508b67b3650dbaf00db407b5eb (diff) |
intel: Check for region allocation failure.
Signed-off-by: Chris Wilson <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_regions.c | 6 |
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 fe4de189600..680d18ba299 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; |