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
eaec7793
Commit
eaec7793
authored
May 14, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 15, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Avoid a NULL dereference in RealizePalette.
parent
34b1482f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
surface.c
dlls/wined3d/surface.c
+17
-7
No files found.
dlls/wined3d/surface.c
View file @
eaec7793
...
...
@@ -1773,14 +1773,24 @@ HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface) {
This
->
Flags
|=
SFLAG_DIRTY
;
}
TRACE
(
"(%p): Updating the palette
\n
"
,
This
);
for
(
n
=
0
;
n
<
256
;
n
++
)
{
col
[
n
].
rgbRed
=
pal
->
palents
[
n
].
peRed
;
col
[
n
].
rgbGreen
=
pal
->
palents
[
n
].
peGreen
;
col
[
n
].
rgbBlue
=
pal
->
palents
[
n
].
peBlue
;
col
[
n
].
rgbReserved
=
0
;
if
(
This
->
Flags
&
SFLAG_DIBSECTION
)
{
TRACE
(
"(%p): Updating the hdc's palette
\n
"
,
This
);
for
(
n
=
0
;
n
<
256
;
n
++
)
{
if
(
pal
)
{
col
[
n
].
rgbRed
=
pal
->
palents
[
n
].
peRed
;
col
[
n
].
rgbGreen
=
pal
->
palents
[
n
].
peGreen
;
col
[
n
].
rgbBlue
=
pal
->
palents
[
n
].
peBlue
;
}
else
{
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
/* Use the default device palette */
col
[
n
].
rgbRed
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peRed
;
col
[
n
].
rgbGreen
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peGreen
;
col
[
n
].
rgbBlue
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peBlue
;
}
col
[
n
].
rgbReserved
=
0
;
}
SetDIBColorTable
(
This
->
hDC
,
0
,
256
,
col
);
}
SetDIBColorTable
(
This
->
hDC
,
0
,
256
,
col
);
return
WINED3D_OK
;
}
...
...
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