[Scummvm-git-logs] scummvm master -> 3a41bed5632fa3171473ebe8efa9048190ac7b42

dreammaster dreammaster at scummvm.org
Tue Feb 14 03:58:31 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3a41bed563 TITANIC: Fix Coverity reported warnings


Commit: 3a41bed5632fa3171473ebe8efa9048190ac7b42
    https://github.com/scummvm/scummvm/commit/3a41bed5632fa3171473ebe8efa9048190ac7b42
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-13T21:58:23-05:00

Commit Message:
TITANIC: Fix Coverity reported warnings

Changed paths:
    engines/titanic/sound/audio_buffer.cpp
    engines/titanic/sound/wave_file.cpp


diff --git a/engines/titanic/sound/audio_buffer.cpp b/engines/titanic/sound/audio_buffer.cpp
index 1f06931..636f4a5 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 b094adb..c9205c7 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();
 }
 





More information about the Scummvm-git-logs mailing list