Truncate dest blit rectangle down to surface size.

oldstable
Marcus Meissner 2000-11-27 23:06:36 +00:00 committed by Alexandre Julliard
parent c7dd25420e
commit e38b41911f
1 changed files with 6 additions and 1 deletions

View File

@ -232,7 +232,12 @@ HRESULT WINAPI IDirectDrawSurface4Impl_Blt(
}
}
if (src) assert((xsrc.bottom-xsrc.top) <= sdesc.dwHeight);
assert((xdst.bottom-xdst.top) <= ddesc.dwHeight);
/* truncate dst rect to dest surface. */
if ((xdst.bottom-xdst.top) > ddesc.dwHeight)
xdst.bottom = xdst.top+ddesc.dwHeight;
if ((xdst.right-xdst.left) > ddesc.dwWidth)
xdst.right = xdst.left+ddesc.dwWidth;
bpp = GET_BPP(ddesc);
srcheight = xsrc.bottom - xsrc.top;