Commit ea6118e9 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Fail earlier in TIFF decoder's Initialize method for unsupported pixel formats.

parent 4af1c0c2
......@@ -638,6 +638,7 @@ static HRESULT WINAPI TiffDecoder_Initialize(IWICBitmapDecoder *iface, IStream *
{
TiffDecoder *This = impl_from_IWICBitmapDecoder(iface);
TIFF *tiff;
tiff_decode_info decode_info;
HRESULT hr=S_OK;
TRACE("(%p,%p,%x)\n", iface, pIStream, cacheOptions);
......@@ -651,13 +652,20 @@ static HRESULT WINAPI TiffDecoder_Initialize(IWICBitmapDecoder *iface, IStream *
}
tiff = tiff_open_stream(pIStream, "r");
if (!tiff)
{
hr = E_FAIL;
goto exit;
}
/* make sure that TIFF format is supported */
hr = tiff_get_decode_info(tiff, &decode_info);
if (hr != S_OK)
{
pTIFFClose(tiff);
goto exit;
}
This->tiff = tiff;
This->stream = pIStream;
IStream_AddRef(pIStream);
......
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