ddraw fix

Marko Kreen marko at l-t.ee
Sun Nov 10 14:31:02 CST 2002

> > Probably application bug: it called DIB_DirectDrawSurface_Blt
> > with .bottom > 36000, seems like DirectDraw sanitized the
> > values.
> Well, I would prefer the fix to be different... For example, it seems to be
> valid to have negative top values as long as 'bottom - top' is valid (as it
> seems that DDraw will clip the blit for you).
> Problem is that if negative top is valid, then bottom being bigger than
> dwHeight should be valid too. And your patch will thus prevent
> this case to work.

I guess you are right.

> Did you try to simply return an error message (instead of doing the assert)
> to see if you see any graphical glitches ?

Yes, it did give glitches.  After clipping it gave sane picture.
But I dont have any idea how the picture looks on Windows, I
dont have Windows.

Some values from log:

fixme:ddraw:DIB_DirectDrawSurface_Blt ddesc.dwHeight=480 xdst.top=382 xdst.bottom=36242
fixme:ddraw:DIB_DirectDrawSurface_Blt sdesc.dwHeight=480 xsrc.top=381 xsrc.bottom=36242
fixme:ddraw:DIB_DirectDrawSurface_Blt ddesc.dwHeight=480 xdst.top=381 xdst.bottom=36242
fixme:ddraw:DIB_DirectDrawSurface_Blt sdesc.dwHeight=480 xsrc.top=382 xsrc.bottom=36242

> Anyway, I am installing Mingw + the DirectX SDKs to do some test apps on a
> Win2K laptop. I will try this case to see if I manage to see what real
> Windows does.

Cool.  I looked into DDraw docs in web, but there was no
descripton for special cases.  I tried to fantasize but it got
too crazy for me...


More information about the wine-devel mailing list