Module: wine Branch: master Commit: 31e5218286f0686304b8aaa62b626dcfd9b202c6 URL: https://gitlab.winehq.org/wine/wine/-/commit/31e5218286f0686304b8aaa62b626dc...
Author: Davide Beatrici git@davidebeatrici.dev Date: Mon Aug 21 13:11:46 2023 +0200
winepulse: Fix crash when requesting exclusive mode with an unsupported format.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55362
---
dlls/winepulse.drv/pulse.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 0e587033a6d..370c361b02f 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -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; }