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 FastBlt().
This fixes a crash for the little game "Treasure Mole Winter Vacations":
http://www.alawar.com/games/treasuremolewv/
The game is now fully playable.
/Pedro
- 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.
Vitaliy.