Vincent Povirk : gdiplus: Don't set a palette when loading non-indexed images.
Alexandre Julliard
julliard at winehq.org
Fri May 15 16:55:06 CDT 2020
Module: wine
Branch: master
Commit: ed2d0df4f78a7f73564fcc5cbf94a54e3475fe31
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ed2d0df4f78a7f73564fcc5cbf94a54e3475fe31
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Thu May 14 20:51:09 2020 -0500
gdiplus: Don't set a palette when loading non-indexed images.
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdiplus/image.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index 4fd7d95a9c..17cccf2b42 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -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);
More information about the wine-cvs
mailing list