AUDIO: Fix VOC infinite loop
This fixes a possible infinite loop in VocStream. It depends on the stream size matching the size specified in the VOC block headers, but if the size in the headers is incorrect and larger than the stream size, it will keep trying to read the stream. This is fixed by adding an end-of-stream check to the error check.
This commit is contained in:
parent
796166b501
commit
e208659aa8
1 changed files with 2 additions and 2 deletions
|
@ -168,9 +168,9 @@ int VocStream::fillBuffer(int maxSamples) {
|
|||
maxSamples -= samplesRead;
|
||||
_blockLeft -= samplesRead;
|
||||
|
||||
// In case of an error we will stop
|
||||
// In case of an error or end of stream we will stop
|
||||
// stream playback.
|
||||
if (_stream->err()) {
|
||||
if (_stream->err() || _stream->eos()) {
|
||||
_blockLeft = 0;
|
||||
_curBlock = _blocks.end();
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue