[Mesa-dev] [PATCH 07/16] i965/miptree: Check for miptree_create() failures

Topi Pohjolainen topi.pohjolainen at gmail.com
Mon Jul 17 13:34:58 UTC 2017


Rest of the function assumes it always succeeds.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index bef544c0ae..a77684dc18 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -887,6 +887,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
-- 
2.11.0



More information about the mesa-dev mailing list