From: Julien Isorce Date: Tue, 20 Oct 2015 16:34:23 +0000 (+0100) Subject: nvc0: fix crash when nv50_miptree_from_handle fails X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3bbb8715acd1cb85ea7aa7763c06cd12347a1a9a;p=mesa.git nvc0: fix crash when nv50_miptree_from_handle fails Signed-off-by: Julien Isorce Reviewed-by: Samuel Pitoiset --- diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c index 12b5a025064..15c803c4307 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c @@ -26,7 +26,8 @@ nvc0_resource_from_handle(struct pipe_screen * screen, } else { struct pipe_resource *res = nv50_miptree_from_handle(screen, templ, whandle); - nv04_resource(res)->vtbl = &nvc0_miptree_vtbl; + if (res) + nv04_resource(res)->vtbl = &nvc0_miptree_vtbl; return res; } }