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
2680f330
Commit
2680f330
authored
Sep 18, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Check box dimensions in volume_map.
parent
ac37f7a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
volume.c
dlls/wined3d/volume.c
+27
-0
No files found.
dlls/wined3d/volume.c
View file @
2680f330
...
@@ -566,6 +566,28 @@ static BOOL volume_check_block_align(const struct wined3d_volume *volume,
...
@@ -566,6 +566,28 @@ static BOOL volume_check_block_align(const struct wined3d_volume *volume,
return
TRUE
;
return
TRUE
;
}
}
static
BOOL
wined3d_volume_check_box_dimensions
(
const
struct
wined3d_volume
*
volume
,
const
struct
wined3d_box
*
box
)
{
if
(
!
box
)
return
TRUE
;
if
(
box
->
left
>=
box
->
right
)
return
FALSE
;
if
(
box
->
top
>=
box
->
bottom
)
return
FALSE
;
if
(
box
->
front
>=
box
->
back
)
return
FALSE
;
if
(
box
->
right
>
volume
->
resource
.
width
)
return
FALSE
;
if
(
box
->
bottom
>
volume
->
resource
.
height
)
return
FALSE
;
if
(
box
->
back
>
volume
->
resource
.
depth
)
return
FALSE
;
return
TRUE
;
}
HRESULT
CDECL
wined3d_volume_map
(
struct
wined3d_volume
*
volume
,
HRESULT
CDECL
wined3d_volume_map
(
struct
wined3d_volume
*
volume
,
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
DWORD
flags
)
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
DWORD
flags
)
{
{
...
@@ -589,6 +611,11 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
...
@@ -589,6 +611,11 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
WARN
(
"Volume is already mapped.
\n
"
);
WARN
(
"Volume is already mapped.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
}
}
if
(
!
wined3d_volume_check_box_dimensions
(
volume
,
box
))
{
WARN
(
"Map box is invalid.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
if
((
format
->
flags
&
WINED3DFMT_FLAG_BLOCKS
)
&&
!
volume_check_block_align
(
volume
,
box
))
if
((
format
->
flags
&
WINED3DFMT_FLAG_BLOCKS
)
&&
!
volume_check_block_align
(
volume
,
box
))
{
{
WARN
(
"Map box is misaligned for %ux%u blocks.
\n
"
,
WARN
(
"Map box is misaligned for %ux%u blocks.
\n
"
,
...
...
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