From 47c0678a1b2c8ad71bdc9187d1ffda10a6ac4dc4 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 23 Oct 2016 05:07:46 -0400 Subject: [PATCH] deal with possible NULL ptr --- src/sound/audiostr.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sound/audiostr.cpp b/src/sound/audiostr.cpp index 3e3f771..fda7784 100644 --- a/src/sound/audiostr.cpp +++ b/src/sound/audiostr.cpp @@ -1171,7 +1171,12 @@ void AudioStream::Play(float volume, int looping) // get source id if we don't have one if ( !m_source_id ) { sound_channel *chan = oal_get_free_channel(1.0f, -1, SND_PRIORITY_MUST_PLAY); - m_source_id = chan->source_id; + + if (chan) { + m_source_id = chan->source_id; + } else { + return; + } } // Cue for playback if necessary -- 2.39.2