Module: wine Branch: master Commit: a91a7bf5a7602afa0e735f69782897a497290f25 URL: https://gitlab.winehq.org/wine/wine/-/commit/a91a7bf5a7602afa0e735f69782897a...
Author: Anton Baskanov baskanov@gmail.com Date: Thu May 16 14:17:09 2024 +0700
quartz: Hold the streaming lock while calling ICDecompressEnd.
Otherwise, the streaming thread might try to access the decompressor while it's being destroyed.
---
dlls/quartz/avidec.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c index d7f97e0380c..f494efdf1e8 100644 --- a/dlls/quartz/avidec.c +++ b/dlls/quartz/avidec.c @@ -573,10 +573,16 @@ static HRESULT avi_decompressor_cleanup_stream(struct strmbase_filter *iface) if (!filter->source.pin.peer) return S_OK;
- if (filter->hvid && (res = ICDecompressEnd(filter->hvid))) + if (filter->hvid) { - ERR("ICDecompressEnd() failed, error %Id.\n", res); - return E_FAIL; + EnterCriticalSection(&filter->filter.stream_cs); + res = ICDecompressEnd(filter->hvid); + LeaveCriticalSection(&filter->filter.stream_cs); + if (res) + { + ERR("ICDecompressEnd() failed, error %Id.\n", res); + return E_FAIL; + } }
IMemAllocator_Decommit(filter->source.pAllocator);