https://bugs.winehq.org/show_bug.cgi?id=48492
--- Comment #9 from Ilia Mirkin imirkin@alum.mit.edu --- The only guidance I see regarding what can be in the bitfields is from https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapv5...
""" When the bV5Compression member is BI_BITFIELDS, bits set in each DWORD mask must be contiguous and should not overlap the bits of another mask. All the bits in the pixel do not need to be used. """
So it probably has to handle arbitrary(ish) masks. The patch from Dmitry also does in-place fixups to the data -- is that acceptable? Without knowing more, I would have assumed that the data comes from the application or is otherwise read-only.