From 5dec767af1c35d1eb1422b51b477d7a0b18acdf3 Mon Sep 17 00:00:00 2001 From: dmitrykos Date: Mon, 10 Sep 2018 23:09:44 +0300 Subject: [PATCH] wasapi: fixed crash on NULL --- src/hostapi/wasapi/pa_win_wasapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hostapi/wasapi/pa_win_wasapi.c b/src/hostapi/wasapi/pa_win_wasapi.c index 36abc07..20b49f6 100644 --- a/src/hostapi/wasapi/pa_win_wasapi.c +++ b/src/hostapi/wasapi/pa_win_wasapi.c @@ -2462,7 +2462,7 @@ static PaError GetClosestFormat(IAudioClient *client, double sampleRate, const P WAVEFORMATEX *sharedClosestMatch = NULL; HRESULT hr = !S_OK; PaStreamParameters params = (*_params); - const BOOL explicitFormat = ((streamInfo->flags & paWinWasapiExplicitSampleFormat) == paWinWasapiExplicitSampleFormat); + const BOOL explicitFormat = (streamInfo != NULL) && ((streamInfo->flags & paWinWasapiExplicitSampleFormat) == paWinWasapiExplicitSampleFormat); (void)output; /* It was not noticed that 24-bit Input producing no output while device accepts this format. -- 2.43.0