quartz: Hold the streaming lock while calling ICDecompressEnd.

Otherwise, the streaming thread might try to access the decompressor while it's being destroyed.
This commit is contained in:
Anton Baskanov 2024-05-16 14:17:09 +07:00 committed by Alexandre Julliard
parent e6a6e6545b
commit a91a7bf5a7

View file

@ -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);