? END ? PATCH_DDRAW ? START Index: dlls/ddraw/dsurface/dib.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/dsurface/dib.c,v retrieving revision 1.17 diff -u -r1.17 dib.c --- dlls/ddraw/dsurface/dib.c 18 Oct 2002 23:48:59 -0000 1.17 +++ dlls/ddraw/dsurface/dib.c 19 Oct 2002 08:51:40 -0000 @@ -802,14 +802,22 @@ ddesc.dwSize = sizeof(ddesc); IDirectDrawSurface7_Lock(iface,NULL,&ddesc,DDLOCK_WRITEONLY,0); - if (!rsrc) { + if (!rsrc) { WARN("rsrc is NULL!\n"); rsrc = &rsrc2; rsrc->left = rsrc->top = 0; rsrc->right = sdesc.dwWidth; rsrc->bottom = sdesc.dwHeight; - } - + } + + if (((rsrc->left < 0) || (rsrc->left > sdesc.dwWidth)) || + ((rsrc->right < 0) || (rsrc->right > sdesc.dwWidth)) || + ((rsrc->top < 0) || (rsrc->top > sdesc.dwHeight)) || + ((rsrc->bottom < 0) || (rsrc->bottom > sdesc.dwHeight))) { + WARN("Negative values in blit rectangles. Unhandled for now.\n"); + return DDERR_UNSUPPORTED; + } + bpp = GET_BPP(This->surface_desc); sbuf = (BYTE *)sdesc.lpSurface+(rsrc->top*sdesc.u1.lPitch)+rsrc->left*bpp; dbuf = (BYTE *)ddesc.lpSurface+(dsty*ddesc.u1.lPitch)+dstx* bpp;