[Scummvm-git-logs] scummvm master -> 9d028ac4accab47bbf05956b1cfccf3f482f2328

sev- sev at scummvm.org
Fri Sep 20 21:58:14 CEST 2019


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:
9d028ac4ac HDB: Guard for corrupted sound data


Commit: 9d028ac4accab47bbf05956b1cfccf3f482f2328
    https://github.com/scummvm/scummvm/commit/9d028ac4accab47bbf05956b1cfccf3f482f2328
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-09-20T21:55:08+02:00

Commit Message:
HDB: Guard for corrupted sound data

Changed paths:
    engines/hdb/sound.cpp


diff --git a/engines/hdb/sound.cpp b/engines/hdb/sound.cpp
index 842b145..4579212 100644
--- a/engines/hdb/sound.cpp
+++ b/engines/hdb/sound.cpp
@@ -1538,6 +1538,11 @@ void Sound::playSound(int index) {
 		audioStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
 	}
 
+	if (audioStream == 0) {
+		warning("playSound: sound %d is corrupt", index);
+		return;
+	}
+
 	g_hdb->_mixer->playStream(
 		Audio::Mixer::kSFXSoundType,
 		&_handles[soundChannel],
@@ -1597,6 +1602,11 @@ void Sound::playSoundEx(int index, int channel, bool loop) {
 		audioStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
 	}
 
+	if (audioStream == 0) {
+		warning("playSoundEx: sound %d is corrupt", index);
+		return;
+	}
+
 	if (loop) {
 		Audio::AudioStream *loopingStream = new Audio::LoopingAudioStream(audioStream, 0, DisposeAfterUse::YES);
 		g_hdb->_mixer->playStream(





More information about the Scummvm-git-logs mailing list