diff options
author | Max Horn | 2003-07-28 20:25:09 +0000 |
---|---|---|
committer | Max Horn | 2003-07-28 20:25:09 +0000 |
commit | ed6521f332db8557ba701add71f493fc3186fdb2 (patch) | |
tree | f42c81ae55d4625e84d38c62672dea950079a2e0 /sound | |
parent | c6a4a1d37d17a36940e581d3aa7163550a637012 (diff) | |
download | scummvm-rg350-ed6521f332db8557ba701add71f493fc3186fdb2.tar.gz scummvm-rg350-ed6521f332db8557ba701add71f493fc3186fdb2.tar.bz2 scummvm-rg350-ed6521f332db8557ba701add71f493fc3186fdb2.zip |
fix for bug #776169
svn-id: r9259
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mixer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 4d04132822..83e48799db 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -933,6 +933,7 @@ void ChannelMP3CDMusic::mix(int16 *data, uint len) { memset(_ptr, 0, _bufferSize); _size = _file->read(_ptr, _bufferSize); if (_size <= 0) { + debug(1, "Failed to read MP3 data during channel initialisation !"); destroy(); return; } @@ -1006,6 +1007,9 @@ void ChannelMP3CDMusic::mix(int16 *data, uint len) { memcpy(_ptr, _stream.next_frame, not_decoded); _size = _file->read(_ptr + not_decoded, _bufferSize - not_decoded); } + if (_size <= 0) { + return; + } _stream.error = (enum mad_error)0; // Restream mad_stream_buffer(&_stream, _ptr, _size + not_decoded); |