summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorChris Wilson <[email protected]>2017-07-31 10:22:44 +0100
committerKenneth Graunke <[email protected]>2017-08-01 21:28:09 -0700
commitf28c2e225668ed7977b301100140f4f7e7bf55e6 (patch)
tree027641a9748af604799585d02c894958c0273820 /src/mesa/drivers
parent246690b683cbd1b3e596b8cc3ef1c86b65fb671e (diff)
i965: Check result of make_surface() for intel_miptree_create_for_bo
Since make_surface() can fail, if the format isn't support by hw or simlar error, we need to check the result before dereferencing it. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 628d80c0ff8..daa49f99228 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -792,6 +792,8 @@ intel_miptree_create_for_bo(struct brw_context *brw,
0, 0, width, height, depth, 1, ISL_TILING_Y0_BIT,
ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT,
BO_ALLOC_FOR_RENDER, pitch, bo);
+ if (!mt)
+ return NULL;
brw_bo_reference(bo);