gdiplus: Don't set a palette when loading non-indexed images.

Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Vincent Povirk 2020-05-14 20:51:09 -05:00 committed by Alexandre Julliard
parent c4ef987429
commit ed2d0df4f7
1 changed files with 6 additions and 6 deletions

View File

@ -58,11 +58,11 @@ static const struct
{ &GUID_WICPixelFormat4bppIndexed, PixelFormat4bppIndexed, WICBitmapPaletteTypeFixedHalftone8 },
{ &GUID_WICPixelFormat8bppIndexed, PixelFormat8bppIndexed, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat8bppGray, PixelFormat8bppIndexed, WICBitmapPaletteTypeFixedGray256 },
{ &GUID_WICPixelFormat16bppBGR555, PixelFormat16bppRGB555, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat24bppBGR, PixelFormat24bppRGB, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat32bppBGR, PixelFormat32bppRGB, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat32bppBGRA, PixelFormat32bppARGB, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat32bppPBGRA, PixelFormat32bppPARGB, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat16bppBGR555, PixelFormat16bppRGB555, 0 },
{ &GUID_WICPixelFormat24bppBGR, PixelFormat24bppRGB, 0 },
{ &GUID_WICPixelFormat32bppBGR, PixelFormat32bppRGB, 0 },
{ &GUID_WICPixelFormat32bppBGRA, PixelFormat32bppARGB, 0 },
{ &GUID_WICPixelFormat32bppPBGRA, PixelFormat32bppPARGB, 0 },
{ NULL }
};
@ -82,7 +82,7 @@ static ColorPalette *get_palette(IWICBitmapFrameDecode *frame, WICBitmapPaletteT
hr = WINCODEC_ERR_PALETTEUNAVAILABLE;
if (frame)
hr = IWICBitmapFrameDecode_CopyPalette(frame, wic_palette);
if (hr != S_OK)
if (hr != S_OK && palette_type != 0)
{
TRACE("using predefined palette %#x\n", palette_type);
hr = IWICPalette_InitializePredefined(wic_palette, palette_type, FALSE);