windowscodecs: Fail earlier in TIFF decoder's Initialize method for unsupported pixel formats.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Vincent Povirk <vincent@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
4af1c0c246
commit
ea6118e9b7
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue