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:
parent
31a3118de6
commit
3562c2bd7a
@ -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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user