diff options
author | Patrick Rudolph <[email protected]> | 2015-10-22 17:02:16 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-02-04 22:12:17 +0100 |
commit | 996f76bd8a6444970e57d646ad5af94f200bec00 (patch) | |
tree | fccec0f6adab09d11ab2bc09cb3f95699e2ad591 | |
parent | 40a0b97ebdcfeebc79d9cbf03fb78f84c3f599ba (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]>
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 3 |
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); } |