i965/miptree: Check for miptree_create() failures
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 20 Jun 2017 14:36:46 +0000 (17:36 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 18 Jul 2017 18:35:03 +0000 (21:35 +0300)
Rest of the function assumes it always succeeds.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index f48d83432413b203bfd1a52aaab06ca282ce6ea7..da454add98033fd0cddee1e29c5bc65b164ac896 100644 (file)
@@ -889,6 +889,8 @@ intel_miptree_create(struct brw_context *brw,
                                      first_level, last_level,
                                      width0, height0, depth0, num_samples,
                                      layout_flags);
+   if (!mt)
+      return NULL;
 
    /* If the BO is too large to fit in the aperture, we need to use the
     * BLT engine to support it.  Prior to Sandybridge, the BLT paths can't