Merge branch 'winrt' into 'master'

WASAPI: Fixed crash on NULL.

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/6794444
This commit is contained in:
Dmitry Kostjuchenko 2018-09-10 20:11:25 +00:00
commit c0d239712d

View File

@ -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.