Mercurial > mplayer.hg
changeset 30790:9f30c9cb599b
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. :-)
author | sesse |
---|---|
date | Thu, 04 Mar 2010 15:31:54 +0000 |
parents | d0b1d60bab20 |
children | d8d15a9fcc43 |
files | loader/win32.c |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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;