aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2017-03-22 09:10:50 +0100
committerEugene Sandulenko2017-03-22 09:10:50 +0100
commita0253001d837c1a937956c6e48bccfd50a07a188 (patch)
treea459ad39f6f65577011667822999ecf5363a70b9
parent4591dd966a13a4c7eaced7a7413945ad45545de8 (diff)
downloadscummvm-rg350-a0253001d837c1a937956c6e48bccfd50a07a188.tar.gz
scummvm-rg350-a0253001d837c1a937956c6e48bccfd50a07a188.tar.bz2
scummvm-rg350-a0253001d837c1a937956c6e48bccfd50a07a188.zip
DIRECTOR: Added sanity check for broken score files
-rw-r--r--engines/director/score.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 83fe6dd5c0..609c8abc7c 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -317,7 +317,7 @@ void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) {
byte channelData[kChannelDataSize];
memset(channelData, 0, kChannelDataSize);
- while (size != 0) {
+ while (size != 0 && !stream.eos()) {
uint16 frameSize = stream.readUint16();
debugC(kDebugLoading, 8, "++++ score frame %d (frameSize %d) size %d", _frames.size(), frameSize, size);
size -= frameSize;