diff options
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/graphics.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 2990d024d2..0e6f10f6af 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -1110,7 +1110,15 @@ void PathBuffer::free() { } byte PathBuffer::getValue(uint16 x, uint16 y) const { - byte m = data[(x >> 3) + y * internalWidth]; + byte m = 0; + if (data) { + uint index = (x >> 3) + y * internalWidth; + if (index < size) + m = data[index]; + else + warning("PathBuffer::getValue(x: %d, y: %d) outside of data buffer of size %d", x, y, size); + } else + warning("PathBuffer::getValue() attempted to use NULL data buffer"); uint bit = bigEndian ? (x & 7) : (7 - (x & 7)); return ((1 << bit) & m) >> bit; } |