aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--video/smk_decoder.cpp6
-rw-r--r--video/smk_decoder.h2
2 files changed, 3 insertions, 5 deletions
diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index 366c434b1b..0a1bcea1dc 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -485,7 +485,6 @@ bool SmackerDecoder::load(Common::SeekableReadStream *stream) {
// Height needs to be doubled if we have flags (Y-interlaced or Y-doubled)
_surface->create(width, height * (_header.flags ? 2 : 1), 1);
- _palette = (byte *)malloc(3 * 256);
memset(_palette, 0, 3 * 256);
return true;
}
@@ -519,7 +518,6 @@ void SmackerDecoder::close() {
delete[] _frameSizes;
delete[] _frameTypes;
- free(_palette);
reset();
}
@@ -858,8 +856,8 @@ void SmackerDecoder::unpackPalette() {
uint32 len = 4 * _fileStream->readByte();
byte *chunk = (byte *)malloc(len);
- _fileStream->read(&chunk[0], len);
- byte *p = &chunk[0];
+ _fileStream->read(chunk, len);
+ byte *p = chunk;
byte oldPalette[3*256];
memcpy(oldPalette, _palette, 3 * 256);
diff --git a/video/smk_decoder.h b/video/smk_decoder.h
index 3476dbe534..6150335763 100644
--- a/video/smk_decoder.h
+++ b/video/smk_decoder.h
@@ -119,7 +119,7 @@ protected:
byte *_frameTypes;
byte *_frameData;
// The RGB palette
- byte *_palette;
+ byte _palette[3 * 256];
bool _dirtyPalette;
Common::Rational _frameRate;