1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 14:14:47 +01:00

add guardlines to HeapAlloc too in case bitmap creation fails

This commit is contained in:
FunkyFr3sh 2018-12-02 07:31:53 +01:00
parent 9605f4a4c4
commit 6b0fbce7f8

View File

@ -1132,7 +1132,7 @@ HRESULT __stdcall ddraw_CreateSurface(IDirectDrawImpl *This, LPDDSURFACEDESC lpD
Surface->bmi->bmiHeader.biHeight = -Surface->height;
if (!Surface->bitmap)
Surface->surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Surface->lPitch * Surface->height * Surface->lXPitch);
Surface->surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Surface->lPitch * (Surface->height + 200) * Surface->lXPitch);
SelectObject(Surface->hDC, Surface->bitmap);
}