aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2017-08-04 13:03:49 -0500
committerColin Snover2017-08-04 13:30:02 -0500
commit3874f454e0bdc9e76e47c7d7339a43fe61b0bdf3 (patch)
tree55710b5020bda21d0e7d9136dfa6bbd414da6bec /engines
parent5412bda5abf562760b1dc6c4e2d1aed57ecda27a (diff)
downloadscummvm-rg350-3874f454e0bdc9e76e47c7d7339a43fe61b0bdf3.tar.gz
scummvm-rg350-3874f454e0bdc9e76e47c7d7339a43fe61b0bdf3.tar.bz2
scummvm-rg350-3874f454e0bdc9e76e47c7d7339a43fe61b0bdf3.zip
SCI32: Always initialize RobotDecoder::_syncFrame
This flag previously was only being initialized in Robot files with audio. This means the flag was incorrectly carried to Robots without audio, and if the first Robot played by the game had no audio, it would be a garbage read. (This latter thing happens at the beginning of Lighthouse.)
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/video/robot_decoder.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index 4d62b51b47..948f437fdb 100644
--- a/engines/sci/video/robot_decoder.cpp
+++ b/engines/sci/video/robot_decoder.cpp
@@ -397,8 +397,6 @@ void RobotDecoder::initPlayback() {
}
void RobotDecoder::initAudio() {
- _syncFrame = true;
-
_audioRecordInterval = RobotAudioStream::kRobotSampleRate / _frameRate;
_expectedAudioBlockSize = _audioBlockSize - kAudioBlockHeaderSize;
@@ -539,6 +537,7 @@ void RobotDecoder::open(const GuiResourceId robotId, const reg_t plane, const in
initPlayback();
+ _syncFrame = true;
_audioBlockSize = _stream->readUint16();
_primerZeroCompressFlag = _stream->readSint16();
_stream->seek(2, SEEK_CUR); // unused