(audio_mixer.c) Prevent null pointer dereference

This commit is contained in:
twinaphex 2017-05-08 05:55:20 +02:00
parent 5e7f175545
commit 5245590bae
2 changed files with 3 additions and 2 deletions

View File

@ -455,7 +455,8 @@ audio_mixer_voice_t* audio_mixer_play(audio_mixer_sound_t* sound, bool repeat,
void audio_mixer_stop(audio_mixer_voice_t* voice)
{
voice->stop_cb(voice, AUDIO_MIXER_SOUND_STOPPED);
if (voice && voice->stop_cb)
voice->stop_cb(voice, AUDIO_MIXER_SOUND_STOPPED);
}
static void mix_wav(float* buffer, size_t num_frames, audio_mixer_voice_t* voice)

View File

@ -1051,10 +1051,10 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
/* Preliminary stuff that has to be done before we
* load the actual content. Can differ per mode. */
runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL);
#ifdef HAVE_MENU
menu_driver_ctl(RARCH_MENU_CTL_UNSET_LOAD_NO_CONTENT, NULL);
#endif
runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL);
runloop_ctl(RUNLOOP_CTL_DATA_DEINIT, NULL);
runloop_ctl(RUNLOOP_CTL_TASK_INIT, NULL);