From aef8d2b04bfc2f3e28a5b58e55a7a27fa9da74ee Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 8 Jun 2009 17:47:37 +0000 Subject: Fix out of bounds memory access in Screen::drawShape. svn-id: r41379 --- engines/kyra/screen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 2b3a9366e6..1a28f9b48f 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -1409,6 +1409,9 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int _dsOffscreenLeft /= _dsScaleW; } + if (shapeHeight <= 0 || shpWidthScaled1 <= 0) + return; + if (pageNum == 0 || pageNum == 1) addDirtyRect(x, y, shpWidthScaled1, shapeHeight); clearOverlayRect(pageNum, x, y, shpWidthScaled1, shapeHeight); -- cgit v1.2.3