aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-17 11:39:42 +0200
committerEugene Sandulenko2016-08-17 11:39:42 +0200
commitb01a58e82cd06e77533ae9209f9956ac6775127f (patch)
tree58e32fcf5960139da1b648b82b7a74850742fc7f /engines
parent7702c62dfd29a75660d7709702d7ea7371629274 (diff)
downloadscummvm-rg350-b01a58e82cd06e77533ae9209f9956ac6775127f.tar.gz
scummvm-rg350-b01a58e82cd06e77533ae9209f9956ac6775127f.tar.bz2
scummvm-rg350-b01a58e82cd06e77533ae9209f9956ac6775127f.zip
DIRECTOR: Fix memory override
Diffstat (limited to 'engines')
-rw-r--r--engines/director/dib.cpp2
-rw-r--r--engines/director/score.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/engines/director/dib.cpp b/engines/director/dib.cpp
index 8c54ba5363..04665e7d34 100644
--- a/engines/director/dib.cpp
+++ b/engines/director/dib.cpp
@@ -62,7 +62,7 @@ void DIBDecoder::loadPalette(Common::SeekableReadStream &stream) {
uint16 steps = stream.size() / 6;
uint16 index = (steps * 3) - 1;
_paletteColorCount = steps;
- _palette = new byte[index];
+ _palette = new byte[index + 1];
for (uint8 i = 0; i < steps; i++) {
_palette[index - 2] = stream.readByte();
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index bd3def53c6..7a2f8f7c8c 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -201,7 +201,7 @@ void Score::loadPalette(Common::SeekableSubReadStreamEndian &stream) {
uint16 steps = stream.size() / 6;
uint16 index = (steps * 3) - 1;
uint16 _paletteColorCount = steps;
- byte *_palette = new byte[index];
+ byte *_palette = new byte[index + 1];
for (uint8 i = 0; i < steps; i++) {
_palette[index - 2] = stream.readByte();