# HG changeset patch # User sesse # Date 1267716714 0 # Node ID 9f30c9cb599bf15026d6f8d6b4a08c39537c2e39 # Parent d0b1d60bab20eb91a12643ebed67585a6d01dec3 Fix crashes in CreatePalette by fixing the LOGPALETTE struct. CreatePalette had problems for me, and looking at the code it was quite obvious why; someone had reversed the order of the two elements of the LOGPALETTE struct, causing it to allocate and copy a bogus amount of memory. Why on earth anybody would want to do that is beyond me; whoever did it even left a comment, but it wasn't very helpful, as it crashed nevertheless. :-) diff -r d0b1d60bab20 -r 9f30c9cb599b loader/win32.c --- a/loader/win32.c Thu Mar 04 15:28:02 2010 +0000 +++ b/loader/win32.c Thu Mar 04 15:31:54 2010 +0000 @@ -4701,10 +4701,9 @@ BYTE peFlags; } PALETTEENTRY; -/* reversed the first 2 entries */ typedef struct tagLOGPALETTE { + WORD palVersion; WORD palNumEntries; - WORD palVersion; PALETTEENTRY palPalEntry[1]; } LOGPALETTE;