aboutsummaryrefslogtreecommitdiff
path: root/engines/tony/gfxcore.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-08-01 22:34:00 +0200
committerTorbjörn Andersson2012-08-01 22:34:00 +0200
commit846f9644ddd471b6e6c7b147e971382dddda14fb (patch)
tree7b51eba2bcd32d94dc15f0bf9838fb411b774628 /engines/tony/gfxcore.cpp
parentfab814b7747be31278fbbfa1d46e28115cd6624e (diff)
downloadscummvm-rg350-846f9644ddd471b6e6c7b147e971382dddda14fb.tar.gz
scummvm-rg350-846f9644ddd471b6e6c7b147e971382dddda14fb.tar.bz2
scummvm-rg350-846f9644ddd471b6e6c7b147e971382dddda14fb.zip
TONY: Clip width to avoid crash when drawing flipped sprite
This fixes - or at least work around - a failed assertion when Pantagruel leaves the office at the beginning of the game.
Diffstat (limited to 'engines/tony/gfxcore.cpp')
-rw-r--r--engines/tony/gfxcore.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp
index ca6dd45c14..0c331cc0e9 100644
--- a/engines/tony/gfxcore.cpp
+++ b/engines/tony/gfxcore.cpp
@@ -927,6 +927,9 @@ void RMGfxSourceBuffer8RLE::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPri
u = _dimx - (width + u);
x1 = (prim->getDst()._x1 + _dimx - 1) - u;
+ if (width > x1)
+ width = x1;
+
// Specify the drawn area
bigBuf.addDirtyRect(Common::Rect(x1 - width, y1, x1, y1 + height));