[Mesa-dev] [PATCH 73/75] st/nine: Prevent crash in GetRenderTargetData
Axel Davy
axel.davy at ens.fr
Wed Oct 5 20:09:46 UTC 2016
From: Patrick Rudolph <siro at das-labor.org>
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 <siro at das-labor.org>
Reviewed-by: Axel Davy <axel.davy at ens.fr>
---
src/gallium/state_trackers/nine/device9.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index eda4c78..0c9e78b 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -1461,6 +1461,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;
--
2.10.0
More information about the mesa-dev
mailing list