=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: ddraw: Add DDBLT_COLORFILL validation.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Mar 17 11:01:59 CDT 2015
Module: wine
Branch: master
Commit: 6cb795b4b6879a9a023229fe07d8301447c515cc
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6cb795b4b6879a9a023229fe07d8301447c515cc
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Mon Mar 16 14:48:52 2015 +0100
ddraw: Add DDBLT_COLORFILL validation.
---
dlls/ddraw/surface.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index cbf11da..8b25cb9 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -1537,6 +1537,28 @@ static HRESULT WINAPI ddraw_surface7_Blt(IDirectDrawSurface7 *iface, RECT *DestR
wined3d_mutex_lock();
+ if (Flags & DDBLT_COLORFILL)
+ {
+ if (src_surface)
+ {
+ wined3d_mutex_unlock();
+ WARN("DDBLT_COLORFILL is not compatible with source surfaces, returning DDERR_INVALIDPARAMS\n");
+ return DDERR_INVALIDPARAMS;
+ }
+ if (!DDBltFx)
+ {
+ wined3d_mutex_unlock();
+ WARN("DDBLT_COLORFILL used with DDBltFx = NULL, returning DDERR_INVALIDPARAMS.\n");
+ return DDERR_INVALIDPARAMS;
+ }
+ if (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
+ {
+ wined3d_mutex_unlock();
+ WARN("DDBLT_COLORFILL used on a depth buffer, returning DDERR_INVALIDPARAMS.\n");
+ return DDERR_INVALIDPARAMS;
+ }
+ }
+
if (Flags & DDBLT_KEYSRC && (!src_surface || !(src_surface->surface_desc.dwFlags & DDSD_CKSRCBLT)))
{
WARN("DDBLT_KEYDEST blit without color key in surface, returning DDERR_INVALIDPARAMS\n");
More information about the wine-cvs
mailing list