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
871aa9d1
Commit
871aa9d1
authored
Dec 17, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Dec 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Check params in IDirect3DRMMeshBuilder2Impl_GetVertices + tests.
parent
1cd551cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
meshbuilder.c
dlls/d3drm/meshbuilder.c
+8
-0
d3drm.c
dlls/d3drm/tests/d3drm.c
+18
-0
No files found.
dlls/d3drm/meshbuilder.c
View file @
871aa9d1
...
...
@@ -801,14 +801,22 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetVertices(IDirect3DRMMeshBui
TRACE
(
"(%p)->(%p,%p,%p,%p,%p,%p)
\n
"
,
This
,
vcount
,
vertices
,
ncount
,
normals
,
face_data_size
,
face_data
);
if
(
vertices
&&
(
!
vcount
||
(
*
vcount
<
This
->
nb_vertices
)))
return
D3DRMERR_BADVALUE
;
if
(
vcount
)
*
vcount
=
This
->
nb_vertices
;
if
(
vertices
&&
This
->
nb_vertices
)
memcpy
(
vertices
,
This
->
pVertices
,
This
->
nb_vertices
*
sizeof
(
D3DVECTOR
));
if
(
normals
&&
(
!
ncount
||
(
*
ncount
<
This
->
nb_normals
)))
return
D3DRMERR_BADVALUE
;
if
(
ncount
)
*
ncount
=
This
->
nb_normals
;
if
(
normals
&&
This
->
nb_normals
)
memcpy
(
normals
,
This
->
pNormals
,
This
->
nb_normals
*
sizeof
(
D3DVECTOR
));
if
(
face_data
&&
(
!
face_data_size
||
(
*
face_data_size
<
This
->
face_data_size
)))
return
D3DRMERR_BADVALUE
;
if
(
face_data_size
)
*
face_data_size
=
This
->
face_data_size
;
if
(
face_data
&&
This
->
face_data_size
)
...
...
dlls/d3drm/tests/d3drm.c
View file @
871aa9d1
...
...
@@ -393,6 +393,24 @@ static void test_MeshBuilder(void)
val
=
IDirect3DRMMeshBuilder_GetFaceCount
(
pMeshBuilder
);
ok
(
val
==
1
,
"Wrong number of faces %d (must be 1)
\n
"
,
val
);
/* Check no buffer size and too small buffer size errors */
val1
=
1
;
val2
=
3
;
val3
=
8
;
hr
=
IDirect3DRMMeshBuilder_GetVertices
(
pMeshBuilder
,
&
val1
,
v
,
&
val2
,
n
,
&
val3
,
f
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"IDirect3DRMMeshBuilder_GetVertices returned %#x
\n
"
,
hr
);
hr
=
IDirect3DRMMeshBuilder_GetVertices
(
pMeshBuilder
,
NULL
,
v
,
&
val2
,
n
,
&
val3
,
f
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"IDirect3DRMMeshBuilder_GetVertices returned %#x
\n
"
,
hr
);
val1
=
3
;
val2
=
1
;
val3
=
8
;
hr
=
IDirect3DRMMeshBuilder_GetVertices
(
pMeshBuilder
,
&
val1
,
v
,
&
val2
,
n
,
&
val3
,
f
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"IDirect3DRMMeshBuilder_GetVertices returned %#x
\n
"
,
hr
);
hr
=
IDirect3DRMMeshBuilder_GetVertices
(
pMeshBuilder
,
&
val1
,
v
,
NULL
,
n
,
&
val3
,
f
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"IDirect3DRMMeshBuilder_GetVertices returned %#x
\n
"
,
hr
);
val1
=
3
;
val2
=
3
;
val3
=
1
;
hr
=
IDirect3DRMMeshBuilder_GetVertices
(
pMeshBuilder
,
&
val1
,
v
,
&
val2
,
n
,
&
val3
,
f
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"IDirect3DRMMeshBuilder_GetVertices returned %#x
\n
"
,
hr
);
hr
=
IDirect3DRMMeshBuilder_GetVertices
(
pMeshBuilder
,
&
val1
,
v
,
&
val2
,
n
,
NULL
,
f
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"IDirect3DRMMeshBuilder_GetVertices returned %#x
\n
"
,
hr
);
val1
=
3
;
val2
=
3
;
val3
=
8
;
hr
=
IDirect3DRMMeshBuilder_GetVertices
(
pMeshBuilder
,
&
val1
,
v
,
&
val2
,
n
,
&
val3
,
f
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get vertices information (hr = %x)
\n
"
,
hr
);
ok
(
val1
==
3
,
"Wrong number of vertices %d (must be 3)
\n
"
,
val1
);
...
...
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