From: Patrick Rudolph Date: Wed, 28 Sep 2016 16:50:19 +0000 (+0200) Subject: st/nine: Prevent crash in GetRenderTargetData X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5d85253dc30cc26a40fa6f4a52cf61880827edee;p=mesa.git 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 --- 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;