File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -346,6 +346,12 @@ uint32_t FAudio_CreateSourceVoice(
346346 LOG_API_ENTER (audio )
347347 LOG_FORMAT (audio , pSourceFormat )
348348
349+ if (pSendList == NULL && audio - > master == NULL )
350+ {
351+ LOG_ERROR (audio , "CreateSourceVoice called before mastering voice was initialized" )
352+ return FAUDIO_E_INVALID_CALL ;
353+ }
354+
349355 * ppSourceVoice = (FAudioSourceVoice * ) audio -> pMalloc (sizeof (FAudioVoice ));
350356 FAudio_zero (* ppSourceVoice , sizeof (FAudioSourceVoice ));
351357 (* ppSourceVoice )-> audio = audio ;
@@ -671,6 +677,12 @@ uint32_t FAudio_CreateSubmixVoice(
671677
672678 LOG_API_ENTER (audio )
673679
680+ if (pSendList == NULL && audio -> master == NULL )
681+ {
682+ LOG_ERROR (audio , "CreateSourceVoice called before mastering voice was initialized" )
683+ return FAUDIO_E_INVALID_CALL ;
684+ }
685+
674686 * ppSubmixVoice = (FAudioSubmixVoice * ) audio -> pMalloc (sizeof (FAudioVoice ));
675687 FAudio_zero (* ppSubmixVoice , sizeof (FAudioSubmixVoice ));
676688 (* ppSubmixVoice )-> audio = audio ;
Original file line number Diff line number Diff line change @@ -1738,6 +1738,7 @@ uint32_t FAudio_INTERNAL_VoiceOutputFrequency(
17381738 if ((pSendList == NULL ) || (pSendList -> SendCount == 0 ))
17391739 {
17401740 /* When we're deliberately given no sends, use master rate! */
1741+ FAudio_assert (voice -> audio -> master != NULL );
17411742 outSampleRate = voice -> audio -> master -> master .inputSampleRate ;
17421743 }
17431744 else
You can’t perform that action at this time.
0 commit comments