mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-01 16:35:20 +00:00
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:
parent
efb8774734
commit
2af9ab6f61
@ -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++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user