[MPlayer-cvslog] r30832 - trunk/loader/win32.c

sesse subversion at mplayerhq.hu
Thu Mar 4 16:31:54 CET 2010


Author: sesse
Date: Thu Mar  4 16:31:54 2010
New Revision: 30832

Log:
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. :-)

Modified:
   trunk/loader/win32.c

Modified: trunk/loader/win32.c
==============================================================================
--- trunk/loader/win32.c	Thu Mar  4 16:28:02 2010	(r30831)
+++ trunk/loader/win32.c	Thu Mar  4 16:31:54 2010	(r30832)
@@ -4701,10 +4701,9 @@ typedef struct tagPALETTEENTRY {
     BYTE peFlags;
 } PALETTEENTRY;
 
-/* reversed the first 2 entries */
 typedef struct tagLOGPALETTE {
-    WORD         palNumEntries;
     WORD         palVersion;
+    WORD         palNumEntries;
     PALETTEENTRY palPalEntry[1];
 } LOGPALETTE;
 


More information about the MPlayer-cvslog mailing list