winepulse: Fix crash when requesting exclusive mode with an unsupported format.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55362
This commit is contained in:
Davide Beatrici 2023-08-21 13:11:46 +02:00 committed by Alexandre Julliard
parent 797a8bb192
commit 31e5218286

View file

@ -2221,9 +2221,14 @@ static NTSTATUS pulse_is_format_supported(void *args)
break;
}
/* This driver does not support exclusive mode. */
if (exclusive && params->result == S_OK)
params->result = params->flow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED;
if (exclusive) { /* This driver does not support exclusive mode. */
if (params->result == S_OK)
params->result = params->flow == eCapture ?
AUDCLNT_E_UNSUPPORTED_FORMAT :
AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED;
else if (params->result == S_FALSE)
params->result = AUDCLNT_E_UNSUPPORTED_FORMAT;
}
return STATUS_SUCCESS;
}