[1/2] windowscodecs: Reimplement GetFrameCount of the GIF decoder.

Dmitry Timoshkov dmitry at baikal.ru
Thu Nov 22 04:26:28 CST 2012


---
 dlls/windowscodecs/gifformat.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c
index 4fa10e0..eb8a37b 100644
--- a/dlls/windowscodecs/gifformat.c
+++ b/dlls/windowscodecs/gifformat.c
@@ -1241,13 +1241,14 @@ static HRESULT WINAPI GifDecoder_GetFrameCount(IWICBitmapDecoder *iface,
     UINT *pCount)
 {
     GifDecoder *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->gif->ImageCount;
+    EnterCriticalSection(&This->lock);
+    *pCount = This->gif ? This->gif->ImageCount : 0;
+    LeaveCriticalSection(&This->lock);
 
-    TRACE("<- %u\n", *pCount);
+    TRACE("(%p) <-- %d\n", iface, *pCount);
 
     return S_OK;
 }
-- 
1.7.12.4




More information about the wine-patches mailing list