Module: wine Branch: master Commit: 075d28d8570341060af65e0fb3b218efe8399da8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=075d28d8570341060af65e0fb3... Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Nov 23 11:48:28 2012 +0800 windowscodecs: Reimplement GetFrameCount of the ICO decoder. --- dlls/windowscodecs/icoformat.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index 6b454c2..6606341 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -603,12 +603,14 @@ static HRESULT WINAPI IcoDecoder_GetFrameCount(IWICBitmapDecoder *iface, UINT *pCount) { IcoDecoder *This = impl_from_IWICBitmapDecoder(iface); - TRACE("(%p,%p)\n", iface, pCount); - if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; + if (!pCount) return E_INVALIDARG; - *pCount = This->header.idCount; - TRACE("<-- %u\n", *pCount); + EnterCriticalSection(&This->lock); + *pCount = This->initialized ? This->header.idCount : 0; + LeaveCriticalSection(&This->lock); + + TRACE("(%p) <-- %d\n", iface, *pCount); return S_OK; }