Commit 4f16c2f7 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Reimplement TiffDecoder_GetFrameCount using TIFFNumberOfDirectories.

parent 7fbf5c23
...@@ -58,7 +58,7 @@ static void *libtiff_handle; ...@@ -58,7 +58,7 @@ static void *libtiff_handle;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f #define MAKE_FUNCPTR(f) static typeof(f) * p##f
MAKE_FUNCPTR(TIFFClientOpen); MAKE_FUNCPTR(TIFFClientOpen);
MAKE_FUNCPTR(TIFFClose); MAKE_FUNCPTR(TIFFClose);
MAKE_FUNCPTR(TIFFCurrentDirectory); MAKE_FUNCPTR(TIFFNumberOfDirectories);
MAKE_FUNCPTR(TIFFGetField); MAKE_FUNCPTR(TIFFGetField);
MAKE_FUNCPTR(TIFFIsByteSwapped); MAKE_FUNCPTR(TIFFIsByteSwapped);
MAKE_FUNCPTR(TIFFReadDirectory); MAKE_FUNCPTR(TIFFReadDirectory);
...@@ -89,7 +89,7 @@ static void *load_libtiff(void) ...@@ -89,7 +89,7 @@ static void *load_libtiff(void)
} }
LOAD_FUNCPTR(TIFFClientOpen); LOAD_FUNCPTR(TIFFClientOpen);
LOAD_FUNCPTR(TIFFClose); LOAD_FUNCPTR(TIFFClose);
LOAD_FUNCPTR(TIFFCurrentDirectory); LOAD_FUNCPTR(TIFFNumberOfDirectories);
LOAD_FUNCPTR(TIFFGetField); LOAD_FUNCPTR(TIFFGetField);
LOAD_FUNCPTR(TIFFIsByteSwapped); LOAD_FUNCPTR(TIFFIsByteSwapped);
LOAD_FUNCPTR(TIFFReadDirectory); LOAD_FUNCPTR(TIFFReadDirectory);
...@@ -662,8 +662,7 @@ static HRESULT WINAPI TiffDecoder_GetFrameCount(IWICBitmapDecoder *iface, ...@@ -662,8 +662,7 @@ static HRESULT WINAPI TiffDecoder_GetFrameCount(IWICBitmapDecoder *iface,
} }
EnterCriticalSection(&This->lock); EnterCriticalSection(&This->lock);
while (pTIFFReadDirectory(This->tiff)) { } *pCount = pTIFFNumberOfDirectories(This->tiff);
*pCount = pTIFFCurrentDirectory(This->tiff)+1;
LeaveCriticalSection(&This->lock); LeaveCriticalSection(&This->lock);
TRACE("(%p) <-- %i\n", iface, *pCount); TRACE("(%p) <-- %i\n", iface, *pCount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment