Commit b81e96eb authored by Ivan de Saedeleer's avatar Ivan de Saedeleer Committed by Alexandre Julliard

Fail when LPRECT contains negative values.

parent 18c9ee81
......@@ -1014,6 +1014,13 @@ static HRESULT WINAPI IDirectDrawSurface4Impl_Blt(
}
if (rdst) {
if ((rdst->top < 0) ||
(rdst->left < 0) ||
(rdst->bottom < 0) ||
(rdst->right < 0)) {
ERR(" Negative values in LPRECT !!!\n");
goto release;
}
memcpy(&xdst,rdst,sizeof(xdst));
} else {
xdst.top = 0;
......@@ -1023,6 +1030,13 @@ static HRESULT WINAPI IDirectDrawSurface4Impl_Blt(
}
if (rsrc) {
if ((rsrc->top < 0) ||
(rsrc->left < 0) ||
(rsrc->bottom < 0) ||
(rsrc->right < 0)) {
ERR(" Negative values in LPRECT !!!\n");
goto release;
}
memcpy(&xsrc,rsrc,sizeof(xsrc));
} else {
if (src) {
......@@ -1204,6 +1218,7 @@ static HRESULT WINAPI IDirectDrawSurface4Impl_Blt(
FIXME("\tUnsupported flags: ");
_dump_DDBLT(dwFlags);
}
release:
IDirectDrawSurface4_Unlock(iface,ddesc.u1.lpSurface);
if (src) IDirectDrawSurface4_Unlock(src,sdesc.u1.lpSurface);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment