aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/smush/codec47.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/scumm/smush/codec47.cpp b/engines/scumm/smush/codec47.cpp
index 8dd8b0cffe..4bf2581365 100644
--- a/engines/scumm/smush/codec47.cpp
+++ b/engines/scumm/smush/codec47.cpp
@@ -531,8 +531,10 @@ Codec47Decoder::Codec47Decoder(int width, int height) {
_height = height;
_tableBig = (byte *)malloc(256 * 388);
_tableSmall = (byte *)malloc(256 * 128);
- makeTablesInterpolation(4);
- makeTablesInterpolation(8);
+ if ((_tableBig != NULL) && (_tableSmall != NULL)) {
+ makeTablesInterpolation(4);
+ makeTablesInterpolation(8);
+ }
_frameSize = _width * _height;
_deltaSize = _frameSize * 3;
@@ -562,6 +564,9 @@ Codec47Decoder::~Codec47Decoder() {
}
bool Codec47Decoder::decode(byte *dst, const byte *src) {
+ if ((_tableBig == NULL) || (_tableSmall == NULL) || (_deltaBuf == NULL))
+ return false;
+
_offset1 = _deltaBufs[1] - _curBuf;
_offset2 = _deltaBufs[0] - _curBuf;