Esme Povirk (@madewokherd) commented about dlls/windowscodecs/imgfactory.c:
+ if (!hpal && + (IsEqualGUID(&format, &GUID_WICPixelFormat1bppIndexed) || + IsEqualGUID(&format, &GUID_WICPixelFormat4bppIndexed) || + IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed))) + { + HDC hdc_palette = CreateCompatibleDC(0); + char bmibuf_palette[FIELD_OFFSET(BITMAPINFO, bmiColors[256])]; + BITMAPINFO *bmi_palette = (BITMAPINFO *)bmibuf_palette; + bmi_palette->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi_palette->bmiHeader.biBitCount = 0; + + if(GetDIBits(hdc_palette, hbm, 0, 0, NULL, bmi_palette, DIB_RGB_COLORS)) + { + num_palette_entries = bmi_palette->bmiHeader.biClrUsed ? bmi_palette->bmiHeader.biClrUsed : (UINT)(1 << bmi_palette->bmiHeader.biBitCount); + if (GetDIBits(hdc_palette, hbm, 0, 0, (LPVOID)entry, bmi_palette, DIB_RGB_COLORS))
I'm confused about the use of `entry` here. That argument is supposed to point to bitmap bits? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9436#note_121722