From f32e92b849b99e6001bc426c08edabf07762ca45 Mon Sep 17 00:00:00 2001 From: sesse Date: Thu, 4 Mar 2010 15:31:54 +0000 Subject: 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. :-) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30832 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'loader') diff --git a/loader/win32.c b/loader/win32.c index 20eda49c01..f31de74730 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -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; -- cgit v1.2.3