-- v5: mmdevapi: Add nullcheck for parameter that can be null (Coverity) winealsa: Remove superflous check wineoss: Remove superflous check
From: Fabian Maurer dark.shadow4@web.de
--- dlls/wineoss.drv/oss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index 9a7a0fbb5d9..89e626f39d6 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -551,7 +551,7 @@ static HRESULT setup_oss_device(AUDCLNT_SHAREMODE share, int fd, if(ret == S_FALSE && !out) ret = AUDCLNT_E_UNSUPPORTED_FORMAT;
- if(ret == S_FALSE && out){ + if(ret == S_FALSE){ closest->Format.nBlockAlign = closest->Format.nChannels * closest->Format.wBitsPerSample / 8; closest->Format.nAvgBytesPerSec =
From: Fabian Maurer dark.shadow4@web.de
--- dlls/winealsa.drv/alsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winealsa.drv/alsa.c b/dlls/winealsa.drv/alsa.c index 94fc3c6fa4b..aa1ad4abe6c 100644 --- a/dlls/winealsa.drv/alsa.c +++ b/dlls/winealsa.drv/alsa.c @@ -2014,7 +2014,7 @@ exit: if(params->result == S_FALSE && !params->fmt_out) params->result = AUDCLNT_E_UNSUPPORTED_FORMAT;
- if(params->result == S_FALSE && params->fmt_out) { + if(params->result == S_FALSE) { closest->Format.nBlockAlign = closest->Format.nChannels * closest->Format.wBitsPerSample / 8; closest->Format.nAvgBytesPerSec = closest->Format.nBlockAlign * closest->Format.nSamplesPerSec; if(closest->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE)
From: Fabian Maurer dark.shadow4@web.de
"out" got checked for null earlier, so we should do it here as well Also added a test that crashes otherwise
Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/mmdevapi/client.c | 3 +++ dlls/mmdevapi/tests/render.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+)
diff --git a/dlls/mmdevapi/client.c b/dlls/mmdevapi/client.c index 8146f8a53b4..c2107196be0 100644 --- a/dlls/mmdevapi/client.c +++ b/dlls/mmdevapi/client.c @@ -649,6 +649,9 @@ static HRESULT WINAPI client_IsFormatSupported(IAudioClient3 *iface, AUDCLNT_SHA
wine_unix_call(is_format_supported, ¶ms);
+ if (params.result == S_FALSE && !out) + return AUDCLNT_E_UNSUPPORTED_FORMAT; + if (params.result == S_FALSE) *out = ¶ms.fmt_out->Format; else diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index 8e000f03acb..3e24ac45944 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -139,11 +139,23 @@ static void test_audioclient(void) HRESULT hr; ULONG ref; WAVEFORMATEX *pwfx, *pwfx2; + WAVEFORMATEXTENSIBLE format_float_error; REFERENCE_TIME t1, t2; HANDLE handle; BOOL offload_capable; AudioClientProperties client_props;
+ format_float_error.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE); + format_float_error.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + format_float_error.Format.nAvgBytesPerSec = 384000; + format_float_error.Format.nBlockAlign = 8; + format_float_error.Format.nChannels = 2; + format_float_error.Format.nSamplesPerSec = 48000; + format_float_error.Format.wBitsPerSample = 32; + format_float_error.Samples.wValidBitsPerSample = 4; + format_float_error.dwChannelMask = 3; + format_float_error.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + hr = IMMDevice_Activate(dev, &IID_IAudioClient3, CLSCTX_INPROC_SERVER, NULL, (void**)&ac3); ok(hr == S_OK || @@ -258,6 +270,10 @@ static void test_audioclient(void) "IsFormatSupported(Exclusive) call returns %08lx\n", hr); hexcl = hr;
+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, &format_float_error.Format, NULL); + ok(hr == S_OK || hr == AUDCLNT_E_UNSUPPORTED_FORMAT || hr == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED, + "IsFormatSupported(Exclusive) call returns %08lx\n", hr); + pwfx2 = (WAVEFORMATEX*)0xDEADF00D; hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, &pwfx2); ok(hr == hexcl, "IsFormatSupported(Exclusive) call returns %08lx\n", hr);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=139565
Your paranoid android.
=== w8adm (32 bit report) ===
mmdevapi: render.c:1358: Test failed: GetBuffer large (20671) at iteration 7
=== w1064v1507 (64 bit report) ===
mmdevapi: render.c:1358: Test failed: GetBuffer large (20671) at iteration 3
=== w1064_adm (64 bit report) ===
mmdevapi: render.c:1358: Test failed: GetBuffer large (22500) at iteration 4
On Wed Jul 26 17:29:17 2023 +0000, Fabian Maurer wrote:
changed this line in [version 4 of the diff](/wine/wine/-/merge_requests/3105/diffs?diff_id=59476&start_sha=c4d570f6b39ce4ddfd7bd958461ffafefa3626cd#99913733944fc35298a259705e992a42b21541f5_653_653)
Any news regarding this?
On Sat Nov 4 14:58:36 2023 +0000, Fabian Maurer wrote:
Any news regarding this?
This now will produce different return value for out == NULL vs out != NULL, this does not look right.
On Sat Nov 4 15:15:09 2023 +0000, Nikolay Sivov wrote:
This now will produce different return value for out == NULL vs out != NULL, this does not look right.
Also see !3575.
On Wed Jul 26 17:34:28 2023 +0000, Fabian Maurer wrote:
Adjusted the code. It is a bit confusing, since the testbot and my machine behave differently... I had changes that failed only locally, and changes that seem to have only failed on the testbot. I hope this iteration one works everywhere. EDIT: Or do you want me to move the check into pulse? Because it's the only driver that doesn't have that
if(ret == S_FALSE && !out) ret = AUDCLNT_E_UNSUPPORTED_FORMAT;
logic.
See !3575.