wine3d3: Check the destination recangle when for FastBlt().
wine-devel at kievinfo.com
Sun Jul 29 15:11:50 CDT 2007
Peter Dons Tychsen wrote:
> Hello Wine!
> I have fixed a small bug in FastBlt(), which caused Wine to crash if the
> application tried to do FastBlt() to a surface using a bad destination
> setup. The problem is already fixed in normal Blt(), but was broken for
> This fixes a crash for the little game "Treasure Mole Winter Vacations":
> The game is now fully playable.
> + if (((lock_dst.bottom > This->currentDesc.Height) || (lock_dst.bottom < 0) ||
> + (lock_dst.top > This->currentDesc.Height) || (lock_dst.top < 0) ||
> + (lock_dst.left > This->currentDesc.Width) || (lock_dst.left < 0) ||
> + (lock_dst.right > This->currentDesc.Width) || (lock_dst.right < 0) ||
> + (lock_dst.right < lock_dst.left) || (lock_dst.bottom < lock_dst.top)))
This check doesn't look right to me. Something like this should be much closer and
much easier to read and understand. Also it doesn't have any redundant checks:
+ if (IsRectEmpty(&lock_dst) ||
+ lock_dst.left >= This->currentDesc.Width || lock_dst.right < 0 ||
+ lock_dst.bottom >= This->currentDesc.Height || lock_dst.top < 0)
">=" because you comparing coordinates against width/height.
More information about the wine-devel