diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index 2f6a9e3c4f3..17085808efe 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -798,7 +798,7 @@ static HRESULT WINAPI PngDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface, png_colorp png_palette; int num_palette; WICColor palette[256]; - png_bytep trans; + png_bytep trans_alpha; int num_trans; png_color_16p trans_values; int i; @@ -822,23 +822,18 @@ static HRESULT WINAPI PngDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface, goto end; } + ret = ppng_get_tRNS(This->png_ptr, This->info_ptr, &trans_alpha, &num_trans, &trans_values); + if (!ret) num_trans = 0; + for (i=0; ipng_ptr, This->info_ptr, &trans, &num_trans, &trans_values); - if (ret) - { - for (i=0; ilock); diff --git a/dlls/windowscodecs/tests/pngformat.c b/dlls/windowscodecs/tests/pngformat.c index 61c56b351f9..a222ebc8bd8 100644 --- a/dlls/windowscodecs/tests/pngformat.c +++ b/dlls/windowscodecs/tests/pngformat.c @@ -577,9 +577,7 @@ static void test_png_palette(void) hr = IWICPalette_GetColors(palette, 256, color, &ret); ok(hr == S_OK, "GetColors error %#x\n", hr); ok(ret == count, "expected %u, got %u\n", count, ret); -todo_wine ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); -todo_wine ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); IWICPalette_Release(palette);