diff options
author | sesse <sesse@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-04 15:31:54 +0000 |
---|---|---|
committer | sesse <sesse@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-04 15:31:54 +0000 |
commit | f32e92b849b99e6001bc426c08edabf07762ca45 (patch) | |
tree | 5f858d42f827bb5499800c349a70f172ec4f71ff /loader/win32.c | |
parent | c6fb73d6b1e9cbcb469b4a98352c6f3c504ba7fc (diff) | |
download | mpv-f32e92b849b99e6001bc426c08edabf07762ca45.tar.bz2 mpv-f32e92b849b99e6001bc426c08edabf07762ca45.tar.xz |
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
Diffstat (limited to 'loader/win32.c')
-rw-r--r-- | loader/win32.c | 3 |
1 files changed, 1 insertions, 2 deletions
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; |