diff options
author | Colin Snover | 2017-09-09 22:32:55 -0500 |
---|---|---|
committer | Colin Snover | 2017-09-09 23:29:58 -0500 |
commit | 41506201b908347ae7fba88cfdd3bcc53e6b4056 (patch) | |
tree | b09ce301fb52776f1234987ca3b615ce7a3125e3 /gui/browser.cpp | |
parent | 393c0d1f6250d0fd13f201c7ae28e51bd8c93215 (diff) | |
download | scummvm-rg350-41506201b908347ae7fba88cfdd3bcc53e6b4056.tar.gz scummvm-rg350-41506201b908347ae7fba88cfdd3bcc53e6b4056.tar.bz2 scummvm-rg350-41506201b908347ae7fba88cfdd3bcc53e6b4056.zip |
AUDIO: Fix incorrect reading of DK3 ADPCM audio data
Previously, _topNibble was not reset at the beginning of a new
audio block, and the alignment byte at the end of odd blocks was
being read as audio data, which caused audible clicks and
out-of-bounds sample generation. There may have also been read
errors related to the use of continue/break keywords inside of a
macro wrapped with do-while(0).
The introduction of partial block reads in this code when it was
converted from ffmpeg to a ReadStream interface was also confusing
and somewhat inefficient (calling SeekableReadStream::pos
frequently), so this code has been refactored for clarity and to
improve efficiency by reducing the number of virtual calls. Error
detection has also been improved somewhat by ensuring that there
are enough bytes to read a block header, and that the step indexes
in the header are within the valid range.
Diffstat (limited to 'gui/browser.cpp')
0 files changed, 0 insertions, 0 deletions