From: Chris Wilson Date: Thu, 5 Aug 2010 07:34:09 +0000 (+0100) Subject: intel: Check for region allocation failure. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=85cfe321805264686ef8989e45a911a999ed928a;p=mesa.git intel: Check for region allocation failure. Signed-off-by: Chris Wilson --- 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;