1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-16 06:18:53 +01:00

add some more error checking

This commit is contained in:
FunkyFr3sh 2022-09-29 17:49:20 +02:00
parent 31a3118de6
commit 3562c2bd7a
2 changed files with 4 additions and 1 deletions

@ -38,6 +38,9 @@ HRESULT ddc_GetClipList(IDirectDrawClipperImpl* This, LPRECT lpRect, LPRGNDATA l
if (lpRect) if (lpRect)
DeleteObject(region); DeleteObject(region);
if (*lpdwSiz == 0)
return DDERR_REGIONTOOSMALL;
return DD_OK; return DD_OK;
} }

@ -79,7 +79,7 @@ HRESULT dds_Blt(
{ {
DWORD size = 0; DWORD size = 0;
if (SUCCEEDED(IDirectDrawClipper_GetClipList(This->clipper, &dst_rect, NULL, &size)) && size > 0) if (SUCCEEDED(IDirectDrawClipper_GetClipList(This->clipper, &dst_rect, NULL, &size)))
{ {
RGNDATA* list = (RGNDATA*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); RGNDATA* list = (RGNDATA*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);