From 5d85253dc30cc26a40fa6f4a52cf61880827edee Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 28 Sep 2016 18:50:19 +0200 Subject: [PATCH] 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 Reviewed-by: Axel Davy --- 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 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; -- 2.30.2