Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c60757b7
Commit
c60757b7
authored
Nov 17, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Avoid accessing the internal palette object from dib.c.
parent
46dd4679
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
24 deletions
+20
-24
dib.c
dlls/gdi32/dib.c
+20
-24
No files found.
dlls/gdi32/dib.c
View file @
c60757b7
...
...
@@ -638,33 +638,33 @@ INT WINAPI GetDIBits(
else
{
if
(
bpp
>=
bmp
->
bitmap
.
bmBitsPixel
)
{
/* Generate the color map from the selected palette */
PALETTEENTRY
*
palEntry
;
PALETTEOBJ
*
palette
;
if
(
!
(
palette
=
(
PALETTEOBJ
*
)
GDI_GetObjPtr
(
dc
->
hPalette
,
PALETTE_MAGIC
)))
{
PALETTEENTRY
palEntry
[
256
];
memset
(
palEntry
,
0
,
sizeof
(
palEntry
)
);
if
(
!
GetPaletteEntries
(
dc
->
hPalette
,
0
,
1
<<
bmp
->
bitmap
.
bmBitsPixel
,
palEntry
))
{
GDI_ReleaseObj
(
hdc
);
GDI_ReleaseObj
(
hbitmap
);
return
0
;
}
palEntry
=
palette
->
logpalette
.
palPalEntry
;
for
(
i
=
0
;
i
<
(
1
<<
bmp
->
bitmap
.
bmBitsPixel
);
i
++
,
palEntry
++
)
{
for
(
i
=
0
;
i
<
(
1
<<
bmp
->
bitmap
.
bmBitsPixel
);
i
++
)
{
if
(
coloruse
==
DIB_RGB_COLORS
)
{
if
(
core_header
)
{
rgbTriples
[
i
].
rgbtRed
=
palEntry
->
peRed
;
rgbTriples
[
i
].
rgbtGreen
=
palEntry
->
peGreen
;
rgbTriples
[
i
].
rgbtBlue
=
palEntry
->
peBlue
;
rgbTriples
[
i
].
rgbtRed
=
palEntry
[
i
].
peRed
;
rgbTriples
[
i
].
rgbtGreen
=
palEntry
[
i
].
peGreen
;
rgbTriples
[
i
].
rgbtBlue
=
palEntry
[
i
].
peBlue
;
}
else
{
rgbQuads
[
i
].
rgbRed
=
palEntry
->
peRed
;
rgbQuads
[
i
].
rgbGreen
=
palEntry
->
peGreen
;
rgbQuads
[
i
].
rgbBlue
=
palEntry
->
peBlue
;
rgbQuads
[
i
].
rgbRed
=
palEntry
[
i
].
peRed
;
rgbQuads
[
i
].
rgbGreen
=
palEntry
[
i
].
peGreen
;
rgbQuads
[
i
].
rgbBlue
=
palEntry
[
i
].
peBlue
;
rgbQuads
[
i
].
rgbReserved
=
0
;
}
}
else
((
WORD
*
)
colorPtr
)[
i
]
=
(
WORD
)
i
;
}
GDI_ReleaseObj
(
dc
->
hPalette
);
}
else
{
switch
(
bpp
)
{
case
1
:
...
...
@@ -1189,21 +1189,17 @@ static void DIB_CopyColorTable( DC *dc, BITMAPOBJ *bmp, WORD coloruse, const BIT
}
else
{
PALETTE
OBJ
*
palette
;
PALETTE
ENTRY
entries
[
256
]
;
const
WORD
*
index
=
(
const
WORD
*
)
((
const
BYTE
*
)
info
+
(
WORD
)
info
->
bmiHeader
.
biSize
);
UINT
count
=
GetPaletteEntries
(
dc
->
hPalette
,
0
,
colors
,
entries
);
if
((
palette
=
GDI_GetObjPtr
(
dc
->
hPalette
,
PALETTE_MAGIC
))
)
for
(
i
=
0
;
i
<
colors
;
i
++
,
index
++
)
{
UINT
entries
=
palette
->
logpalette
.
palNumEntries
;
for
(
i
=
0
;
i
<
colors
;
i
++
,
index
++
)
{
PALETTEENTRY
*
entry
=
&
palette
->
logpalette
.
palPalEntry
[
*
index
%
entries
];
colorTable
[
i
].
rgbRed
=
entry
->
peRed
;
colorTable
[
i
].
rgbGreen
=
entry
->
peGreen
;
colorTable
[
i
].
rgbBlue
=
entry
->
peBlue
;
colorTable
[
i
].
rgbReserved
=
0
;
}
GDI_ReleaseObj
(
dc
->
hPalette
);
PALETTEENTRY
*
entry
=
&
entries
[
*
index
%
count
];
colorTable
[
i
].
rgbRed
=
entry
->
peRed
;
colorTable
[
i
].
rgbGreen
=
entry
->
peGreen
;
colorTable
[
i
].
rgbBlue
=
entry
->
peBlue
;
colorTable
[
i
].
rgbReserved
=
0
;
}
}
bmp
->
color_table
=
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