From 264cfdaa6dd4a05db936f2cf26df40dee85df9b8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 2 Jan 2018 15:17:29 -0800 Subject: [PATCH] i965/miptree: Fail gracefully when make_surface returns NULL Every other caller of make_surface does something sensible when NULL is returned. Signed-off-by: Ian Romanick Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104214 --- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index ead0c35..0079a08 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -719,6 +719,9 @@ miptree_create(struct brw_context *brw, ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT, BO_ALLOC_BUSY, 0, NULL); + if (mt == NULL) + return NULL; + if (needs_separate_stencil(brw, mt, format) && !make_separate_stencil_surface(brw, mt)) { intel_miptree_release(&mt); -- 2.9.5