Mark Harmstone : winepulse: Handle stream create failing correctly.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Nov 4 09:40:40 CST 2015


Module: wine
Branch: master
Commit: 0d7cee0dd6f1008baca9fe03f9959886a00ea7d5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0d7cee0dd6f1008baca9fe03f9959886a00ea7d5

Author: Mark Harmstone <mark at harmstone.com>
Date:   Tue Nov  3 16:21:41 2015 -0600

winepulse: Handle stream create failing correctly.

Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winepulse.drv/mmdevdrv.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
index 6b69488..3895f4c 100644
--- a/dlls/winepulse.drv/mmdevdrv.c
+++ b/dlls/winepulse.drv/mmdevdrv.c
@@ -753,6 +753,12 @@ static HRESULT pulse_stream_connect(ACImpl *This, UINT32 period_bytes) {
     ret = InterlockedIncrement(&number);
     sprintf(buffer, "audio stream #%i", ret);
     This->stream = pa_stream_new(pulse_ctx, buffer, &This->ss, &This->map);
+
+    if (!This->stream) {
+        WARN("pa_stream_new returned error %i\n", pa_context_errno(pulse_ctx));
+        return AUDCLNT_E_ENDPOINT_CREATE_FAILED;
+    }
+
     pa_stream_set_state_callback(This->stream, pulse_stream_state, This);
     pa_stream_set_buffer_attr_callback(This->stream, pulse_attr_update, This);
     pa_stream_set_moved_callback(This->stream, pulse_attr_update, This);




More information about the wine-cvs mailing list