Fix for stupid applications reading some bytes after the end of the

surface memory.
This commit is contained in:
Lionel Ulmer 2003-01-02 20:14:24 +00:00 committed by Alexandre Julliard
parent 00a3d5f3f8
commit 442b235e63
1 changed files with 2 additions and 1 deletions

View File

@ -249,7 +249,8 @@ HRESULT DIB_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl *This,
This->surface_desc.lpSurface
= VirtualAlloc(NULL, This->surface_desc.u1.lPitch
* This->surface_desc.dwHeight,
* This->surface_desc.dwHeight + 4, /* The + 4 here is for dumb games reading after the end of the surface
when reading the last byte / half using word access */
MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
if (This->surface_desc.lpSurface == NULL)