diff options
| -rw-r--r-- | scumm/smush/channel.h | 2 | ||||
| -rw-r--r-- | scumm/smush/smush_player.cpp | 24 |
2 files changed, 7 insertions, 19 deletions
diff --git a/scumm/smush/channel.h b/scumm/smush/channel.h index 87de082ac8..ecd9d1b8ac 100644 --- a/scumm/smush/channel.h +++ b/scumm/smush/channel.h @@ -80,7 +80,7 @@ public: bool appendData(Chunk &b, int32 size); int32 availableSoundData() const; void getSoundData(int16 *sound_buffer, int32 size); - void getSoundData(int8 *sound_buffer, int32 size) { error("16bit request for SAUD channel should never happen"); }; + void getSoundData(int8 *sound_buffer, int32 size) { error("8bit request for SAUD channel should never happen"); }; int32 getRate() { return _frequency; } bool getParameters(int32 &rate, bool &stereo, bool &is_16bit) { rate = _frequency; diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index 5453081f38..5386aec08d 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -419,9 +419,7 @@ void SmushPlayer::handleIACT(Chunk &b) { byte *d_src = src; byte value; - do { - if (bsize == 0) - break; + while (bsize > 0) { if (_IACTpos >= 2) { int32 len = READ_BE_UINT16(_IACToutput) + 2; len -= _IACTpos; @@ -468,26 +466,16 @@ void SmushPlayer::handleIACT(Chunk &b) { _IACTpos = 0; } } else { - if (bsize == 1) { - if (_IACTpos != 0) { - *(_IACToutput + 1) = *d_src++; - _IACTpos = 2; - bsize--; - continue; - } - bsize = 0; - *(_IACToutput + 0) = *d_src; - _IACTpos = 1; - continue; - } else if (_IACTpos == 0) { + if (bsize > 1 && _IACTpos == 0) { *(_IACToutput + 0) = *d_src++; + _IACTpos = 1; bsize--; } - *(_IACToutput + 1) = *d_src++; - _IACTpos = 2; + *(_IACToutput + _IACTpos) = *d_src++; + _IACTpos++; bsize--; } - } while (bsize != 0); + } free(src); } |
