summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Isorce <[email protected]>2015-10-20 17:34:23 +0100
committerEmil Velikov <[email protected]>2015-11-07 15:17:49 +0000
commitbc47b385b4dd2ad1362872bb01a22a5cd50a42c0 (patch)
tree4b06a0360c82788c27a0f8e6a6b65cb46833b6bf
parentdff2b9ed8a8f49d00880a28796841fc0d0c7ec4f (diff)
nvc0: fix crash when nv50_miptree_from_handle fails
Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> (cherry picked from commit 3bbb8715acd1cb85ea7aa7763c06cd12347a1a9a) Nominated-by: Emil Velikov <[email protected]>
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_resource.c3
1 files changed, 2 insertions, 1 deletions
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;
}
}