mirror of
https://github.com/mpv-player/mpv
synced 2025-04-28 06:09:32 +00: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:
parent
c6fb73d6b1
commit
f32e92b849
@ -4701,10 +4701,9 @@ typedef struct tagPALETTEENTRY {
|
|||||||
BYTE peFlags;
|
BYTE peFlags;
|
||||||
} PALETTEENTRY;
|
} PALETTEENTRY;
|
||||||
|
|
||||||
/* reversed the first 2 entries */
|
|
||||||
typedef struct tagLOGPALETTE {
|
typedef struct tagLOGPALETTE {
|
||||||
WORD palNumEntries;
|
|
||||||
WORD palVersion;
|
WORD palVersion;
|
||||||
|
WORD palNumEntries;
|
||||||
PALETTEENTRY palPalEntry[1];
|
PALETTEENTRY palPalEntry[1];
|
||||||
} LOGPALETTE;
|
} LOGPALETTE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user