From c4813275166df87ae83996a7c3c20c19c1aba60c Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sun, 9 May 2021 00:51:02 +0200 Subject: [PATCH] fix SetClipper --- src/ddsurface.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ddsurface.c b/src/ddsurface.c index ed42e85..2fbe230 100644 --- a/src/ddsurface.c +++ b/src/ddsurface.c @@ -870,7 +870,14 @@ HRESULT dds_SetColorKey(IDirectDrawSurfaceImpl *This, DWORD flags, LPDDCOLORKEY HRESULT dds_SetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER lpClipper) { + if (lpClipper) + IDirectDrawClipper_AddRef(lpClipper); + + if (This->clipper) + IDirectDrawClipper_Release(This->clipper); + This->clipper = (IDirectDrawClipperImpl*)lpClipper; + return DD_OK; }