summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2016-09-24 11:34:33 +0200
committerAxel Davy <[email protected]>2016-10-10 23:43:51 +0200
commitfa2574497b25d06258404b83282719dbb477b190 (patch)
tree26b272062f44c28083084eb60bc9e62025ce8833 /src/gallium
parentf04fa0a62c6d39659c38eabd63bff54f0d2833fe (diff)
st/nine: handle possible failure of D3DWindowBuffer_create
Check for errors and pass them to the callers. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/nine/swapchain9.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
index e61111899c7..03bdcd33efe 100644
--- a/src/gallium/state_trackers/nine/swapchain9.c
+++ b/src/gallium/state_trackers/nine/swapchain9.c
@@ -542,6 +542,10 @@ create_present_buffer( struct NineSwapChain9 *This,
*resource = This->screen->resource_create(This->screen, &tmplt);
*present_handle = D3DWindowBuffer_create(This, *resource, 24, true);
+
+ if (!*present_handle) {
+ pipe_resource_reference(resource, NULL);
+ }
}
static void
@@ -878,6 +882,10 @@ NineSwapChain9_GetFrontBufferData( struct NineSwapChain9 *This,
* mode. It may need a fix */
create_present_buffer(This, width, height, &temp_resource, &temp_handle);
+ if (!temp_resource || !temp_handle) {
+ return D3DERR_INVALIDCALL;
+ }
+
desc.Type = D3DRTYPE_SURFACE;
desc.Pool = D3DPOOL_DEFAULT;
desc.MultiSampleType = D3DMULTISAMPLE_NONE;