windowscodecs: Make GetFrameCount in the TIFF decoder not fail without an image stream.
This commit is contained in:
parent
dd2be15118
commit
9e5ecdb745
@ -203,9 +203,7 @@ static void test_QueryCapability(void)
|
|||||||
|
|
||||||
frame_count = 0xdeadbeef;
|
frame_count = 0xdeadbeef;
|
||||||
hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
|
hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
|
||||||
todo_wine
|
|
||||||
ok(hr == S_OK || broken(hr == E_POINTER) /* XP */, "GetFrameCount error %#x\n", hr);
|
ok(hr == S_OK || broken(hr == E_POINTER) /* XP */, "GetFrameCount error %#x\n", hr);
|
||||||
todo_wine
|
|
||||||
ok(frame_count == 0, "expected 0, got %u\n", frame_count);
|
ok(frame_count == 0, "expected 0, got %u\n", frame_count);
|
||||||
|
|
||||||
pos.QuadPart = 4;
|
pos.QuadPart = 4;
|
||||||
@ -222,7 +220,6 @@ todo_wine
|
|||||||
|
|
||||||
frame_count = 0xdeadbeef;
|
frame_count = 0xdeadbeef;
|
||||||
hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
|
hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
|
||||||
todo_wine
|
|
||||||
ok(hr == S_OK, "GetFrameCount error %#x\n", hr);
|
ok(hr == S_OK, "GetFrameCount error %#x\n", hr);
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(frame_count == 1, "expected 1, got %u\n", frame_count);
|
ok(frame_count == 1, "expected 1, got %u\n", frame_count);
|
||||||
|
@ -668,14 +668,10 @@ static HRESULT WINAPI TiffDecoder_GetFrameCount(IWICBitmapDecoder *iface,
|
|||||||
{
|
{
|
||||||
TiffDecoder *This = impl_from_IWICBitmapDecoder(iface);
|
TiffDecoder *This = impl_from_IWICBitmapDecoder(iface);
|
||||||
|
|
||||||
if (!This->tiff)
|
if (!pCount) return E_INVALIDARG;
|
||||||
{
|
|
||||||
WARN("(%p) <-- WINCODEC_ERR_WRONGSTATE\n", iface);
|
|
||||||
return WINCODEC_ERR_WRONGSTATE;
|
|
||||||
}
|
|
||||||
|
|
||||||
EnterCriticalSection(&This->lock);
|
EnterCriticalSection(&This->lock);
|
||||||
*pCount = pTIFFNumberOfDirectories(This->tiff);
|
*pCount = This->tiff ? pTIFFNumberOfDirectories(This->tiff) : 0;
|
||||||
LeaveCriticalSection(&This->lock);
|
LeaveCriticalSection(&This->lock);
|
||||||
|
|
||||||
TRACE("(%p) <-- %i\n", iface, *pCount);
|
TRACE("(%p) <-- %i\n", iface, *pCount);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user