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
0a121076
Commit
0a121076
authored
Apr 28, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Don't use potentially uninitialized data in the depth/stencil state key (Valgrind).
parent
da24b511
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
device.c
dlls/d3d10core/device.c
+15
-2
No files found.
dlls/d3d10core/device.c
View file @
0a121076
...
...
@@ -1744,6 +1744,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Devi
{
struct
d3d10_device
*
device
=
impl_from_ID3D10Device
(
iface
);
struct
d3d10_depthstencil_state
*
object
;
D3D10_DEPTH_STENCIL_DESC
tmp_desc
;
struct
wine_rb_entry
*
entry
;
HRESULT
hr
;
...
...
@@ -1752,7 +1753,19 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Devi
if
(
!
desc
)
return
E_INVALIDARG
;
if
((
entry
=
wine_rb_get
(
&
device
->
depthstencil_states
,
desc
)))
/* D3D10_DEPTH_STENCIL_DESC has a hole, which is a problem because we use
* it as a key in the rbtree. */
memset
(
&
tmp_desc
,
0
,
sizeof
(
tmp_desc
));
tmp_desc
.
DepthEnable
=
desc
->
DepthEnable
;
tmp_desc
.
DepthWriteMask
=
desc
->
DepthWriteMask
;
tmp_desc
.
DepthFunc
=
desc
->
DepthFunc
;
tmp_desc
.
StencilEnable
=
desc
->
StencilEnable
;
tmp_desc
.
StencilReadMask
=
desc
->
StencilReadMask
;
tmp_desc
.
StencilWriteMask
=
desc
->
StencilWriteMask
;
tmp_desc
.
FrontFace
=
desc
->
FrontFace
;
tmp_desc
.
BackFace
=
desc
->
BackFace
;
if
((
entry
=
wine_rb_get
(
&
device
->
depthstencil_states
,
&
tmp_desc
)))
{
object
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
d3d10_depthstencil_state
,
entry
);
...
...
@@ -1767,7 +1780,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Devi
if
(
!
object
)
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d10_depthstencil_state_init
(
object
,
device
,
desc
)))
if
(
FAILED
(
hr
=
d3d10_depthstencil_state_init
(
object
,
device
,
&
tmp_
desc
)))
{
WARN
(
"Failed to initialize depthstencil state, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
...
...
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