Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f3c99197
Commit
f3c99197
authored
Apr 11, 2005
by
Glenn Wurster
Committed by
Alexandre Julliard
Apr 11, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix array index crash in buidling GDI palette from logical palette.
parent
44cb0906
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
dib.c
dlls/x11drv/dib.c
+11
-5
No files found.
dlls/x11drv/dib.c
View file @
f3c99197
...
...
@@ -418,18 +418,24 @@ static RGBQUAD *X11DRV_DIB_BuildColorTable( X11DRV_PDEVICE *physDev, WORD coloru
else
{
HPALETTE
hpal
=
GetCurrentObject
(
physDev
->
hdc
,
OBJ_PAL
);
PALETTEENTRY
pal_ents
[
256
]
;
PALETTEENTRY
*
pal_ents
;
WORD
*
index
=
(
WORD
*
)
((
LPBYTE
)
info
+
(
WORD
)
info
->
bmiHeader
.
biSize
);
int
logcolors
,
entry
;
GetPaletteEntries
(
hpal
,
0
,
256
,
pal_ents
);
logcolors
=
GetPaletteEntries
(
hpal
,
0
,
0
,
NULL
);
pal_ents
=
HeapAlloc
(
GetProcessHeap
(),
0
,
logcolors
*
sizeof
(
*
pal_ents
));
logcolors
=
GetPaletteEntries
(
hpal
,
0
,
logcolors
,
pal_ents
);
for
(
i
=
0
;
i
<
colors
;
i
++
,
index
++
)
{
colorTable
[
i
].
rgbRed
=
pal_ents
[
*
index
].
peRed
;
colorTable
[
i
].
rgbGreen
=
pal_ents
[
*
index
].
peGreen
;
colorTable
[
i
].
rgbBlue
=
pal_ents
[
*
index
].
peBlue
;
entry
=
*
index
%
logcolors
;
colorTable
[
i
].
rgbRed
=
pal_ents
[
entry
].
peRed
;
colorTable
[
i
].
rgbGreen
=
pal_ents
[
entry
].
peGreen
;
colorTable
[
i
].
rgbBlue
=
pal_ents
[
entry
].
peBlue
;
colorTable
[
i
].
rgbReserved
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
pal_ents
);
}
return
colorTable
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment