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 <siro@das-labor.org>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
This commit is contained in:
Patrick Rudolph 2016-09-28 18:50:19 +02:00 committed by Axel Davy
parent 09edc0555f
commit 5d85253dc3

View file

@ -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;