[03/10] windowscodecs: Reimplement GetFrameCount of the ICO decoder.
Dmitry Timoshkov
dmitry at baikal.ru
Thu Nov 22 21:48:28 CST 2012
---
dlls/windowscodecs/icoformat.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c
index 4e83ec0..5fac8cb 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;
}
--
1.7.12.4
More information about the wine-patches
mailing list