[PATCH] mfplat/tests: Fix segfault while exiting

Yuxuan Shui yshuiv7 at gmail.com
Sat Apr 2 17:27:57 CDT 2022


A media source created in test_source_resolver is not shut down, causing the read_thread to read
from freed memory while the program is exiting.

Signed-off-by: Yuxuan Shui <yshuiv7 at gmail.com>
---
 dlls/mfplat/tests/mfplat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index 16d24bbff51..ff18bba57e3 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -603,6 +603,8 @@ static HRESULT WINAPI test_create_from_file_handler_callback_Invoke(IMFAsyncCall
         hr = IMFAsyncResult_GetObject(result, &object2);
         ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
 
+        if (obj_type == MF_OBJECT_MEDIASOURCE)
+            IMFMediaSource_Shutdown((void *)object);
         IUnknown_Release(object);
     }
 
-- 
2.35.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220402/ff033933/attachment.sig>


More information about the wine-devel mailing list