Esme Povirk (@madewokherd) commented about dlls/gdiplus/image.c:
if (palette->Count >= wic_palette->Count) { - palette->Flags = wic_palette->Flags; + palette->Flags = (UINT)type << 8; palette->Count = wic_palette->Count; memcpy(palette->Entries, wic_palette->Entries, wic_palette->Count * sizeof(wic_palette->Entries[0])); + if (transparent) + { + /* If there is transparent color, add additional entry to palette */ + palette->Entries[palette->Count] = 0x00000000; + palette->Count++; + }
We need to adjust the bounds checking (line 6224) to account for the extra transparent color. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10745#note_137806