aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/vqa_decoder.cpp
diff options
context:
space:
mode:
authorKirben2016-11-12 20:09:18 +1100
committerKirben2016-11-12 20:09:18 +1100
commitef99a71d2a27fa88abf891421bfb2b59462b677c (patch)
treeb36ac8aca2fcc612155a93b97e8faeb9cb0c1388 /engines/bladerunner/vqa_decoder.cpp
parent6ab6fb8b1907315bf61a1c29095c83692e9f46be (diff)
downloadscummvm-rg350-ef99a71d2a27fa88abf891421bfb2b59462b677c.tar.gz
scummvm-rg350-ef99a71d2a27fa88abf891421bfb2b59462b677c.tar.bz2
scummvm-rg350-ef99a71d2a27fa88abf891421bfb2b59462b677c.zip
BLADERUNNER: Avoid using alloca, which might not be available on all systems.
Diffstat (limited to 'engines/bladerunner/vqa_decoder.cpp')
-rw-r--r--engines/bladerunner/vqa_decoder.cpp8
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;
}