diff options
author | Eugene Sandulenko | 2017-03-22 09:10:50 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-03-22 09:10:50 +0100 |
commit | a0253001d837c1a937956c6e48bccfd50a07a188 (patch) | |
tree | a459ad39f6f65577011667822999ecf5363a70b9 | |
parent | 4591dd966a13a4c7eaced7a7413945ad45545de8 (diff) | |
download | scummvm-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.cpp | 2 |
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; |