diff --git a/dlls/windowscodecs/tests/tiffformat.c b/dlls/windowscodecs/tests/tiffformat.c index d8cb10a692f..f32f6a5ec5d 100644 --- a/dlls/windowscodecs/tests/tiffformat.c +++ b/dlls/windowscodecs/tests/tiffformat.c @@ -185,6 +185,7 @@ static void test_QueryCapability(void) HRESULT hr; IStream *stream; IWICBitmapDecoder *decoder; + IWICBitmapFrameDecode *frame; static const DWORD exp_caps = WICBitmapDecoderCapabilityCanDecodeAllImages | WICBitmapDecoderCapabilityCanDecodeSomeImages | WICBitmapDecoderCapabilityCanEnumerateMetadata; @@ -206,6 +207,9 @@ static void test_QueryCapability(void) ok(hr == S_OK || broken(hr == E_POINTER) /* XP */, "GetFrameCount error %#x\n", hr); ok(frame_count == 0, "expected 0, got %u\n", frame_count); + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == WINCODEC_ERR_FRAMEMISSING || broken(hr == E_POINTER) /* XP */, "expected WINCODEC_ERR_FRAMEMISSING, got %#x\n", hr); + pos.QuadPart = 4; hr = IStream_Seek(stream, pos, SEEK_SET, NULL); ok(hr == S_OK, "IStream_Seek error %#x\n", hr); @@ -221,6 +225,10 @@ static void test_QueryCapability(void) ok(hr == S_OK, "GetFrameCount error %#x\n", hr); ok(frame_count == 1, "expected 1, got %u\n", frame_count); + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + IWICBitmapFrameDecode_Release(frame); + pos.QuadPart = 0; hr = IStream_Seek(stream, pos, SEEK_CUR, &cur_pos); ok(hr == S_OK, "IStream_Seek error %#x\n", hr); @@ -251,6 +259,10 @@ todo_wine ok(hr == S_OK, "GetFrameCount error %#x\n", hr); ok(frame_count == 1, "expected 1, got %u\n", frame_count); + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + IWICBitmapFrameDecode_Release(frame); + hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnDemand); ok(hr == WINCODEC_ERR_WRONGSTATE, "expected WINCODEC_ERR_WRONGSTATE, got %#x\n", hr); diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index bacc9c58cff..6c29babc271 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -702,7 +702,7 @@ static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface, TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); if (!This->tiff) - return WINCODEC_ERR_WRONGSTATE; + return WINCODEC_ERR_FRAMEMISSING; EnterCriticalSection(&This->lock); res = pTIFFSetDirectory(This->tiff, index);