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 <kenneth@whitecape.org>
This commit is contained in:
parent
246690b683
commit
f28c2e2256
|
@ -792,6 +792,8 @@ intel_miptree_create_for_bo(struct brw_context *brw,
|
||||||
0, 0, width, height, depth, 1, ISL_TILING_Y0_BIT,
|
0, 0, width, height, depth, 1, ISL_TILING_Y0_BIT,
|
||||||
ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT,
|
ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT,
|
||||||
BO_ALLOC_FOR_RENDER, pitch, bo);
|
BO_ALLOC_FOR_RENDER, pitch, bo);
|
||||||
|
if (!mt)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
brw_bo_reference(bo);
|
brw_bo_reference(bo);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue