diff options
author | Patrick Rudolph <[email protected]> | 2016-09-28 18:50:19 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-10-10 23:43:51 +0200 |
commit | 5d85253dc30cc26a40fa6f4a52cf61880827edee (patch) | |
tree | fa62f2c77c137a3ca25cbba6027644edea823520 | |
parent | 09edc0555f91d76001b1ffc0e656b0614abb809a (diff) |
st/nine: Prevent crash in GetRenderTargetData
Return error instead of crashing on source surfaces
with format D3DFMT_NULL.
Fix for issue #236.
Tested on Windows 7.
Signed-off-by: Patrick Rudolph <[email protected]>
Reviewed-by: Axel Davy <[email protected]>
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 47fd3a48b55..b094edeb87d 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -1464,6 +1464,8 @@ NineDevice9_GetRenderTargetData( struct NineDevice9 *This, user_assert(src->desc.Width == dst->desc.Width, D3DERR_INVALIDCALL); user_assert(src->desc.Height == dst->desc.Height, D3DERR_INVALIDCALL); + user_assert(src->desc.Format != D3DFMT_NULL, D3DERR_INVALIDCALL); + NineSurface9_CopyDefaultToMem(dst, src); return D3D_OK; |