Skip to content

Commit

Permalink
SCI32: Always initialize RobotDecoder::_syncFrame
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
csnover committed Aug 4, 2017
1 parent 5412bda commit 3874f45
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions engines/sci/video/robot_decoder.cpp
Expand Up @@ -397,8 +397,6 @@ void RobotDecoder::initPlayback() {
}

void RobotDecoder::initAudio() {
_syncFrame = true;

_audioRecordInterval = RobotAudioStream::kRobotSampleRate / _frameRate;

_expectedAudioBlockSize = _audioBlockSize - kAudioBlockHeaderSize;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3874f45

Please sign in to comment.