From: Patrick Rudolph Date: Thu, 22 Oct 2015 15:02:16 +0000 (+0200) Subject: st/nine: Fix possible crash on error X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=996f76bd8a6444970e57d646ad5af94f200bec00;p=mesa.git st/nine: Fix possible crash on error In case swapchain creation fails This->swapchains[i] might be NULL and causes a crash. Signed-off-by: Patrick Rudolph Reviewed-by: Axel Davy --- diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 9160b16a51f..e4ac61a5a43 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -460,7 +460,8 @@ NineDevice9_dtor( struct NineDevice9 *This ) if (This->swapchains) { for (i = 0; i < This->nswapchains; ++i) - NineUnknown_Unbind(NineUnknown(This->swapchains[i])); + if (This->swapchains[i]) + NineUnknown_Unbind(NineUnknown(This->swapchains[i])); FREE(This->swapchains); }