diff options
-rw-r--r-- | engines/bladerunner/vqa_decoder.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/bladerunner/vqa_decoder.cpp b/engines/bladerunner/vqa_decoder.cpp index 940f53ee25..fe94012c51 100644 --- a/engines/bladerunner/vqa_decoder.cpp +++ b/engines/bladerunner/vqa_decoder.cpp @@ -34,8 +34,6 @@ #include "common/util.h" #include "common/memstream.h" - - namespace BladeRunner { #define kAESC 0x41455343 @@ -488,7 +486,7 @@ bool VQADecoder::readLNIN(Common::SeekableReadStream *s, uint32 size) { if (chd.id != kLNIO || chd.size != 4u * loopNamesCount) return false; - uint32 *loopNameOffsets = (uint32*)alloca(loopNamesCount * sizeof(uint32)); + uint32 *loopNameOffsets = (uint32*)malloc(loopNamesCount * sizeof(uint32)); for (int i = 0; i != loopNamesCount; ++i) { loopNameOffsets[i] = s->readUint32LE(); } @@ -497,7 +495,7 @@ bool VQADecoder::readLNIN(Common::SeekableReadStream *s, uint32 size) { if (chd.id != kLNID) return false; - char *names = (char*)alloca(roundup(chd.size)); + char *names = (char*)malloc(roundup(chd.size)); s->read(names, roundup(chd.size)); for (int i = 0; i != loopNamesCount; ++i) { @@ -509,6 +507,8 @@ bool VQADecoder::readLNIN(Common::SeekableReadStream *s, uint32 size) { // debug("%2d: %s", i, _loopInfo.loops[i].name.c_str()); } + free(loopNameOffsets); + free(names); return true; } |