1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +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

View File

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

View File

@ -79,7 +79,7 @@ HRESULT dds_Blt(
{
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);