From 91cc891b3651fe5de3bbd46578f2965c1f4c7ffb Mon Sep 17 00:00:00 2001 From: Doyle Thai Date: Sat, 26 Nov 2016 13:34:23 +1100 Subject: [PATCH] Add guard against null-audio in init playback --- src/Audio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Audio.c b/src/Audio.c index c9ab759..65382fe 100644 --- a/src/Audio.c +++ b/src/Audio.c @@ -272,6 +272,8 @@ const i32 audio_playVorbis(MemoryArena_ *arena, AudioManager *audioManager, AudioRenderer *audioRenderer, AudioVorbis *vorbis, i32 numPlays) { + if(vorbis) return -1; + i32 result = initRendererForPlayback(arena, audioManager, audioRenderer, vorbis, numPlays); @@ -302,6 +304,8 @@ const i32 audio_streamPlayVorbis(MemoryArena_ *arena, AudioManager *audioManager // TODO(doyle): Streaming leaks memory, we don't free the "copy audio" ASSERT(INVALID_CODE_PATH); + if(vorbis) return -1; + i32 result = initRendererForPlayback(arena, audioManager, audioRenderer, vorbis, numPlays); // NOTE(doyle): We make a copy of the audio vorbis file using all the same