aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2017-02-11 16:50:28 +0100
committerWillem Jan Palenstijn2017-02-11 16:50:28 +0100
commit2af9ab6f612214cd00aa16e83db3ca5e8b0c7f19 (patch)
tree02d74ecbae36f81a379bae0db68d50d4cc381dd3 /engines/drascula
parentefb8774734094313d6ce7a924c2604645c7083fc (diff)
downloadscummvm-rg350-2af9ab6f612214cd00aa16e83db3ca5e8b0c7f19.tar.gz
scummvm-rg350-2af9ab6f612214cd00aa16e83db3ca5e8b0c7f19.tar.bz2
scummvm-rg350-2af9ab6f612214cd00aa16e83db3ca5e8b0c7f19.zip
DRASCULA: Add bound check asserts to copyRect
Bug #7110 showed a crash here. Even though that was likely a compiler error, these extra checks shouldn't hurt.
Diffstat (limited to 'engines/drascula')
-rw-r--r--engines/drascula/graphics.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index 09ff3c6429..dfe012a2ef 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -196,6 +196,11 @@ void DrasculaEngine::copyRect(int xorg, int yorg, int xdes, int ydes, int width,
dest += xdes + ydes * 320;
src += xorg + yorg * 320;
+ assert(xorg >= 0);
+ assert(yorg >= 0);
+ assert(xorg + width <= 320);
+ assert(yorg + height <= 200);
+
int ptr = 0;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {