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
6ad34b16
Commit
6ad34b16
authored
Jan 22, 2012
by
Rico Schüller
Committed by
Alexandre Julliard
Jan 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Reorder argument check in D3DXGetShaderConstantTableEx().
parent
59b365f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
shader.c
dlls/d3dx9_36/shader.c
+21
-14
No files found.
dlls/d3dx9_36/shader.c
View file @
6ad34b16
...
...
@@ -1175,11 +1175,30 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD *byte_code,
TRACE
(
"(%p, %x, %p)
\n
"
,
byte_code
,
flags
,
constant_table
);
if
(
!
byte_code
||
!
constant_table
)
{
WARN
(
"Invalid argument specified.
\n
"
);
return
D3DERR_INVALIDCALL
;
}
hr
=
D3DXFindShaderComment
(
byte_code
,
MAKEFOURCC
(
'C'
,
'T'
,
'A'
,
'B'
),
&
data
,
&
size
);
if
(
hr
!=
D3D_OK
)
{
WARN
(
"CTAB not found.
\n
"
);
return
D3DXERR_INVALIDDATA
;
}
if
(
size
<
sizeof
(
D3DXSHADER_CONSTANTTABLE
))
{
WARN
(
"Invalid CTAB size.
\n
"
);
return
D3DXERR_INVALIDDATA
;
}
ctab_header
=
(
const
D3DXSHADER_CONSTANTTABLE
*
)
data
;
if
(
ctab_header
->
Size
!=
sizeof
(
D3DXSHADER_CONSTANTTABLE
))
{
WARN
(
"Invalid D3DXSHADER_CONSTANTTABLE size.
\n
"
);
return
D3DXERR_INVALIDDATA
;
}
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
...
...
@@ -1191,28 +1210,16 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD *byte_code,
object
->
ID3DXConstantTable_iface
.
lpVtbl
=
&
ID3DXConstantTable_Vtbl
;
object
->
ref
=
1
;
if
(
size
<
sizeof
(
D3DXSHADER_CONSTANTTABLE
))
{
hr
=
D3DXERR_INVALIDDATA
;
goto
error
;
}
object
->
ctab
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
object
->
ctab
)
{
ERR
(
"Out of memory
\n
"
);
hr
=
E_OUTOFMEMORY
;
goto
error
;
HeapFree
(
GetProcessHeap
(),
0
,
object
)
;
return
E_OUTOFMEMORY
;
}
object
->
size
=
size
;
memcpy
(
object
->
ctab
,
data
,
object
->
size
);
ctab_header
=
(
const
D3DXSHADER_CONSTANTTABLE
*
)
data
;
if
(
ctab_header
->
Size
!=
sizeof
(
D3DXSHADER_CONSTANTTABLE
))
{
hr
=
D3DXERR_INVALIDDATA
;
goto
error
;
}
object
->
desc
.
Creator
=
ctab_header
->
Creator
?
object
->
ctab
+
ctab_header
->
Creator
:
NULL
;
object
->
desc
.
Version
=
ctab_header
->
Version
;
object
->
desc
.
Constants
=
ctab_header
->
Constants
;
...
...
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