aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-16 19:25:09 +0000
committerMartin Kiewitz2010-01-16 19:25:09 +0000
commitbc3405cc9e4e29cbe1cbc9e5a8b77d8834a2ea10 (patch)
treedc107a4cfdb4b263996ba77cfebf45a5255219f9 /engines/sci
parent971cfcbd9eb73b5f0c035aa82273384698457269 (diff)
downloadscummvm-rg350-bc3405cc9e4e29cbe1cbc9e5a8b77d8834a2ea10.tar.gz
scummvm-rg350-bc3405cc9e4e29cbe1cbc9e5a8b77d8834a2ea10.tar.bz2
scummvm-rg350-bc3405cc9e4e29cbe1cbc9e5a8b77d8834a2ea10.zip
SCI: view scaling - dont fill left-over bytes if there are no left-over bytes :P
svn-id: r47329
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/view.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 27aada5295..f5f1d539da 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -568,7 +568,8 @@ void View::drawScaled(Common::Rect rect, Common::Rect clipRect, Common::Rect cli
scaledPixel += scaleY;
}
scaledPixelNo++;
- memset(&scalingY[scaledPixelNo], pixelNo - 1, scaledHeight - scaledPixelNo);
+ if (scaledPixelNo < scaledHeight)
+ memset(&scalingY[scaledPixelNo], pixelNo - 1, scaledHeight - scaledPixelNo);
// Create width scaling table
pixelNo = 0;
@@ -583,7 +584,8 @@ void View::drawScaled(Common::Rect rect, Common::Rect clipRect, Common::Rect cli
scaledPixel += scaleX;
}
scaledPixelNo++;
- memset(&scalingX[scaledPixelNo], pixelNo - 1, scaledWidth - scaledPixelNo);
+ if (scaledPixelNo < scaledWidth)
+ memset(&scalingX[scaledPixelNo], pixelNo - 1, scaledWidth - scaledPixelNo);
scaledWidth = MIN(clipRect.width(), scaledWidth);
scaledHeight = MIN(clipRect.height(), scaledHeight);