Zebediah Figura : strmbase/transform: Check whether the source is connected in TransformFilter_Input_Receive().

Alexandre Julliard julliard at winehq.org
Mon Nov 25 16:41:55 CST 2019


Module: wine
Branch: master
Commit: 8bfd6d3285d9c4e91f79445070ecfdbf792ffb9e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8bfd6d3285d9c4e91f79445070ecfdbf792ffb9e

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Fri Nov 22 21:14:01 2019 -0600

strmbase/transform: Check whether the source is connected in TransformFilter_Input_Receive().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/strmbase/transform.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index e7d4d66164..29c385793a 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -59,6 +59,16 @@ static HRESULT WINAPI TransformFilter_Input_Receive(struct strmbase_sink *This,
 
     TRACE("%p\n", This);
 
+    /* We do not expect pin connection state to change while the filter is
+     * running. This guarantee is necessary, since otherwise we would have to
+     * take the filter lock, and we can't take the filter lock from a streaming
+     * thread. */
+    if (!pTransform->source.pMemInputPin)
+    {
+        WARN("Source is not connected, returning VFW_E_NOT_CONNECTED.\n");
+        return VFW_E_NOT_CONNECTED;
+    }
+
     EnterCriticalSection(&pTransform->csReceive);
     if (pTransform->filter.state == State_Stopped)
     {




More information about the wine-cvs mailing list