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.
This commit is contained in:
Willem Jan Palenstijn 2017-02-11 16:50:28 +01:00
parent efb8774734
commit 2af9ab6f61

View File

@ -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++) {