[Scummvm-git-logs] scummvm master -> 45d7978b6158cefec15d7afdcbade3274edae0ce

tag2015 noreply at scummvm.org
Sat Feb 4 11:01:01 UTC 2023


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:
45d7978b61 AGS: Check sound stream isn't null before playing


Commit: 45d7978b6158cefec15d7afdcbade3274edae0ce
    https://github.com/scummvm/scummvm/commit/45d7978b6158cefec15d7afdcbade3274edae0ce
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-02-04T11:57:12+01:00

Commit Message:
AGS: Check sound stream isn't null before playing

Changed paths:
    engines/ags/engine/media/audio/sound_clip.cpp


diff --git a/engines/ags/engine/media/audio/sound_clip.cpp b/engines/ags/engine/media/audio/sound_clip.cpp
index e14604a75d5..9b72896ce47 100644
--- a/engines/ags/engine/media/audio/sound_clip.cpp
+++ b/engines/ags/engine/media/audio/sound_clip.cpp
@@ -147,11 +147,15 @@ void SoundClipWaveBase::poll() {
 
 int SoundClipWaveBase::play() {
 	if (_soundType != Audio::Mixer::kPlainSoundType) {
+		if (!_stream) {
+			warning("Sound stream is null");
+			return 0;
+		}
 		if (_stream->getRate() < 131072)  // maximum accepted value in audio/rate.cpp
 			_mixer->playStream(_soundType, &_soundHandle, _stream,
 							   -1, _vol255, 0, DisposeAfterUse::NO);
 		else
-			warning("Invalid sound clip sample ratio: %d! Skipping", _stream->getRate());
+			warning("Invalid sound clip sample rate: %d! Skipping", _stream->getRate());
 	} else {
 		_waitingToPlay = true;
 	}




More information about the Scummvm-git-logs mailing list