[Scummvm-git-logs] scummvm master -> ef99a71d2a27fa88abf891421bfb2b59462b677c

Kirben kirben at optusnet.com.au
Sat Nov 12 10:10:05 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ef99a71d2a BLADERUNNER: Avoid using alloca, which might not be available on all systems.


Commit: ef99a71d2a27fa88abf891421bfb2b59462b677c
    https://github.com/scummvm/scummvm/commit/ef99a71d2a27fa88abf891421bfb2b59462b677c
Author: Kirben (kirben at optusnet.com.au)
Date: 2016-11-12T20:09:18+11:00

Commit Message:
BLADERUNNER: Avoid using alloca, which might not be available on all systems.

Changed paths:
    engines/bladerunner/vqa_decoder.cpp



diff --git a/engines/bladerunner/vqa_decoder.cpp b/engines/bladerunner/vqa_decoder.cpp
index 940f53e..fe94012 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;
 }
 





More information about the Scummvm-git-logs mailing list