1
mirror of https://github.com/mpv-player/mpv synced 2024-10-30 04:46:41 +01:00

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
This commit is contained in:
sesse 2010-03-04 15:31:54 +00:00
parent c6fb73d6b1
commit f32e92b849

View File

@ -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;