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);