aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2015-10-22 17:02:16 +0200
committerAxel Davy <[email protected]>2016-02-04 22:12:17 +0100
commit996f76bd8a6444970e57d646ad5af94f200bec00 (patch)
treefccec0f6adab09d11ab2bc09cb3f95699e2ad591 /src/gallium/state_trackers
parent40a0b97ebdcfeebc79d9cbf03fb78f84c3f599ba (diff)
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 <[email protected]> Reviewed-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/device9.c3
1 files changed, 2 insertions, 1 deletions
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);
}