wincodecs: Return WINCODEC_ERR_PALETTEUNAVAILABLE for jpeg decoder frame.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-02-14 16:20:47 +03:00 committed by Alexandre Julliard
parent be6e6fb23c
commit 5f6851fb29
2 changed files with 23 additions and 2 deletions

View File

@ -635,8 +635,9 @@ static HRESULT WINAPI JpegDecoder_Frame_GetResolution(IWICBitmapFrameDecode *ifa
static HRESULT WINAPI JpegDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface,
IWICPalette *pIPalette)
{
FIXME("(%p,%p): stub\n", iface, pIPalette);
return E_NOTIMPL;
TRACE("(%p,%p)\n", iface, pIPalette);
return WINCODEC_ERR_PALETTEUNAVAILABLE;
}
static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,

View File

@ -47,6 +47,8 @@ static void test_decode_adobe_cmyk(void)
{
IWICBitmapDecoder *decoder;
IWICBitmapFrameDecode *framedecode;
IWICImagingFactory *factory;
IWICPalette *palette;
HRESULT hr;
HGLOBAL hjpegdata;
char *jpegdata;
@ -77,6 +79,10 @@ static void test_decode_adobe_cmyk(void)
ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
if (FAILED(hr)) return;
hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
&IID_IWICImagingFactory, (void **)&factory);
ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
hjpegdata = GlobalAlloc(GMEM_MOVEABLE, sizeof(jpeg_adobe_cmyk_1x5));
ok(hjpegdata != 0, "GlobalAlloc failed\n");
if (hjpegdata)
@ -125,13 +131,27 @@ static void test_decode_adobe_cmyk(void)
broken(!memcmp(imagedata, expected_imagedata_24bpp, sizeof(expected_imagedata))), /* xp/2003 */
"unexpected image data\n");
}
hr = IWICImagingFactory_CreatePalette(factory, &palette);
ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
hr = IWICBitmapFrameDecode_CopyPalette(framedecode, palette);
ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
IWICPalette_Release(palette);
IWICBitmapFrameDecode_Release(framedecode);
}
IStream_Release(jpegstream);
}
GlobalFree(hjpegdata);
}
IWICBitmapDecoder_Release(decoder);
IWICImagingFactory_Release(factory);
}