From 1fbd58bf33612304b38de1c3d58be96873dd50ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 2 Feb 2021 10:53:26 +0100 Subject: [PATCH] windowscodecs: Use IWICImagingFactory_CreatePalette in write_source. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of PaletteImpl_Create. Signed-off-by: RĂ©mi Bernon Signed-off-by: Esme Povirk Signed-off-by: Alexandre Julliard --- dlls/windowscodecs/wincodecs_common.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/windowscodecs/wincodecs_common.c b/dlls/windowscodecs/wincodecs_common.c index 37ad7128f10..1b146908be9 100644 --- a/dlls/windowscodecs/wincodecs_common.c +++ b/dlls/windowscodecs/wincodecs_common.c @@ -121,9 +121,17 @@ HRESULT write_source(IWICBitmapFrameEncode *iface, if (need_palette) { + IWICImagingFactory *factory; IWICPalette *palette; - hr = PaletteImpl_Create(&palette); + hr = create_instance(&CLSID_WICImagingFactory, &IID_IWICImagingFactory, (void**)&factory); + + if (SUCCEEDED(hr)) + { + hr = IWICImagingFactory_CreatePalette(factory, &palette); + IWICImagingFactory_Release(factory); + } + if (SUCCEEDED(hr)) { hr = IWICBitmapSource_CopyPalette(converted_source, palette);