From d68c8547c5479e2e781819ecfa74b445a2249ff0 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 19 Jan 2011 22:41:12 +0000 Subject: MOHAWK: Don't use a fixed-size array for cue lists. svn-id: r55335 --- engines/mohawk/sound.cpp | 1 + engines/mohawk/sound.h | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index e7386d0017..31d7c37e79 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -404,6 +404,7 @@ Audio::AudioStream *Sound::makeMohawkWaveStream(Common::SeekableReadStream *stre else debug(2, "Cue# chunk found with %d point(s)!", cueList->pointCount); + cueList->points.resize(cueList->pointCount); for (uint16 i = 0; i < cueList->pointCount; i++) { cueList->points[i].sampleFrame = stream->readUint32BE(); diff --git a/engines/mohawk/sound.h b/engines/mohawk/sound.h index 7914dd40fc..96cb555942 100644 --- a/engines/mohawk/sound.h +++ b/engines/mohawk/sound.h @@ -41,7 +41,6 @@ namespace Mohawk { #define MAX_CHANNELS 2 // Can there be more than 2? -#define CUE_MAX 256 struct SLSTRecord { uint16 index; @@ -85,13 +84,15 @@ struct ADPCMStatus { // Holds ADPCM status data, but is irrelevant for us. } *statusItems; }; +struct CueListPoint { + uint32 sampleFrame; + Common::String name; +}; + struct CueList { uint32 size; uint16 pointCount; - struct { - uint32 sampleFrame; - Common::String name; - } points[CUE_MAX]; + Common::Array points; }; enum { -- cgit v1.2.3