Rémi Bernon (@rbernon) commented about dlls/windows.media.speech/recognizer.c:
struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); BOOLEAN running = TRUE, paused = FALSE; + UINT32 frame_count, tmp_buf_size; + BYTE *audio_buf, *tmp_buf; DWORD flags, status; - UINT32 frame_count; HANDLE events[2]; - BYTE *audio_buf;
SetThreadDescription(GetCurrentThread(), L"wine_speech_recognition_session_worker");
IAudioClient_Start(impl->audio_client); IAudioClient_GetBufferSize(impl->audio_client, &frame_count);
+ tmp_buf_size = sizeof(*tmp_buf) * frame_count * impl->capture_wfx.nBlockAlign; + tmp_buf = malloc(tmp_buf_size);
I think the frame count isn't used until this commit, probably it should be queried here. Also I think it'd be nice to handle the allocation error with at least a message, but maybe exiting the thread too. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1948#note_22036