aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-13 21:58:23 -0500
committerPaul Gilbert2017-02-13 21:58:23 -0500
commit3a41bed5632fa3171473ebe8efa9048190ac7b42 (patch)
tree864343db0188bccd43d1e489bcfbdcda7d72374d /engines
parent534ec946dd3448e71956cee54bdc40f26bb976f7 (diff)
downloadscummvm-rg350-3a41bed5632fa3171473ebe8efa9048190ac7b42.tar.gz
scummvm-rg350-3a41bed5632fa3171473ebe8efa9048190ac7b42.tar.bz2
scummvm-rg350-3a41bed5632fa3171473ebe8efa9048190ac7b42.zip
TITANIC: Fix Coverity reported warnings
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/sound/audio_buffer.cpp1
-rw-r--r--engines/titanic/sound/wave_file.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/engines/titanic/sound/audio_buffer.cpp b/engines/titanic/sound/audio_buffer.cpp
index 1f0693181a..636f4a5107 100644
--- a/engines/titanic/sound/audio_buffer.cpp
+++ b/engines/titanic/sound/audio_buffer.cpp
@@ -27,6 +27,7 @@ namespace Titanic {
CAudioBuffer::CAudioBuffer(int maxSize) : _finished(false) {
_data.resize(maxSize);
+ reset();
}
void CAudioBuffer::reset() {
diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp
index b094adbafe..c9205c76ac 100644
--- a/engines/titanic/sound/wave_file.cpp
+++ b/engines/titanic/sound/wave_file.cpp
@@ -171,7 +171,8 @@ void CWaveFile::load(byte *data, uint dataSize) {
// Parse the wave header
Common::MemoryReadStream wavStream(data, dataSize, DisposeAfterUse::NO);
- Audio::loadWAVFromStream(wavStream, _dataSize, _rate, _flags, &_wavType);
+ if (!Audio::loadWAVFromStream(wavStream, _dataSize, _rate, _flags, &_wavType))
+ error("Invalid wave file");
_headerSize = wavStream.pos();
}