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
c08e4927
Commit
c08e4927
authored
Jul 30, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Jul 31, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Check validity of rects before locking surface in Blt.
parent
7e598531
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
45 deletions
+44
-45
surface_base.c
dlls/wined3d/surface_base.c
+44
-45
No files found.
dlls/wined3d/surface_base.c
View file @
c08e4927
...
...
@@ -850,6 +850,50 @@ IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface,
FIXME
(
"Filters not supported in software blit
\n
"
);
}
/* First check for the validity of source / destination rectangles. This was
* verified using a test application + by MSDN.
*/
if
((
Src
!=
NULL
)
&&
(
SrcRect
!=
NULL
)
&&
((
SrcRect
->
bottom
>
Src
->
currentDesc
.
Height
)
||
(
SrcRect
->
bottom
<
0
)
||
(
SrcRect
->
top
>
Src
->
currentDesc
.
Height
)
||
(
SrcRect
->
top
<
0
)
||
(
SrcRect
->
left
>
Src
->
currentDesc
.
Width
)
||
(
SrcRect
->
left
<
0
)
||
(
SrcRect
->
right
>
Src
->
currentDesc
.
Width
)
||
(
SrcRect
->
right
<
0
)
||
(
SrcRect
->
right
<
SrcRect
->
left
)
||
(
SrcRect
->
bottom
<
SrcRect
->
top
)))
{
WARN
(
"Application gave us bad source rectangle for Blt.
\n
"
);
return
WINEDDERR_INVALIDRECT
;
}
/* For the Destination rect, it can be out of bounds on the condition that a clipper
* is set for the given surface.
*/
if
((
/*This->clipper == NULL*/
TRUE
)
&&
(
DestRect
)
&&
((
DestRect
->
bottom
>
This
->
currentDesc
.
Height
)
||
(
DestRect
->
bottom
<
0
)
||
(
DestRect
->
top
>
This
->
currentDesc
.
Height
)
||
(
DestRect
->
top
<
0
)
||
(
DestRect
->
left
>
This
->
currentDesc
.
Width
)
||
(
DestRect
->
left
<
0
)
||
(
DestRect
->
right
>
This
->
currentDesc
.
Width
)
||
(
DestRect
->
right
<
0
)
||
(
DestRect
->
right
<
DestRect
->
left
)
||
(
DestRect
->
bottom
<
DestRect
->
top
)))
{
WARN
(
"Application gave us bad destination rectangle for Blt without a clipper set.
\n
"
);
return
WINEDDERR_INVALIDRECT
;
}
/* Now handle negative values in the rectangles. Warning: only supported for now
in the 'simple' cases (ie not in any stretching / rotation cases).
First, the case where nothing is to be done.
*/
if
((
DestRect
&&
((
DestRect
->
bottom
<=
0
)
||
(
DestRect
->
right
<=
0
)
||
(
DestRect
->
top
>=
(
int
)
This
->
currentDesc
.
Height
)
||
(
DestRect
->
left
>=
(
int
)
This
->
currentDesc
.
Width
)))
||
((
Src
!=
NULL
)
&&
(
SrcRect
!=
NULL
)
&&
((
SrcRect
->
bottom
<=
0
)
||
(
SrcRect
->
right
<=
0
)
||
(
SrcRect
->
top
>=
(
int
)
Src
->
currentDesc
.
Height
)
||
(
SrcRect
->
left
>=
(
int
)
Src
->
currentDesc
.
Width
))
))
{
TRACE
(
"Nothing to be done !
\n
"
);
return
WINED3D_OK
;
}
if
(
Src
==
This
)
{
IWineD3DSurface_LockRect
(
iface
,
&
dlock
,
NULL
,
0
);
...
...
@@ -919,51 +963,6 @@ IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface,
}
}
/* First check for the validity of source / destination rectangles. This was
* verified using a test application + by MSDN.
*/
if
((
Src
!=
NULL
)
&&
((
xsrc
.
bottom
>
Src
->
currentDesc
.
Height
)
||
(
xsrc
.
bottom
<
0
)
||
(
xsrc
.
top
>
Src
->
currentDesc
.
Height
)
||
(
xsrc
.
top
<
0
)
||
(
xsrc
.
left
>
Src
->
currentDesc
.
Width
)
||
(
xsrc
.
left
<
0
)
||
(
xsrc
.
right
>
Src
->
currentDesc
.
Width
)
||
(
xsrc
.
right
<
0
)
||
(
xsrc
.
right
<
xsrc
.
left
)
||
(
xsrc
.
bottom
<
xsrc
.
top
)))
{
WARN
(
"Application gave us bad source rectangle for Blt.
\n
"
);
ret
=
WINEDDERR_INVALIDRECT
;
goto
release
;
}
/* For the Destination rect, it can be out of bounds on the condition that a clipper
* is set for the given surface.
*/
if
((
/*This->clipper == NULL*/
TRUE
)
&&
((
xdst
.
bottom
>
This
->
currentDesc
.
Height
)
||
(
xdst
.
bottom
<
0
)
||
(
xdst
.
top
>
This
->
currentDesc
.
Height
)
||
(
xdst
.
top
<
0
)
||
(
xdst
.
left
>
This
->
currentDesc
.
Width
)
||
(
xdst
.
left
<
0
)
||
(
xdst
.
right
>
This
->
currentDesc
.
Width
)
||
(
xdst
.
right
<
0
)
||
(
xdst
.
right
<
xdst
.
left
)
||
(
xdst
.
bottom
<
xdst
.
top
)))
{
WARN
(
"Application gave us bad destination rectangle for Blt without a clipper set.
\n
"
);
ret
=
WINEDDERR_INVALIDRECT
;
goto
release
;
}
/* Now handle negative values in the rectangles. Warning: only supported for now
in the 'simple' cases (ie not in any stretching / rotation cases).
First, the case where nothing is to be done.
*/
if
(((
xdst
.
bottom
<=
0
)
||
(
xdst
.
right
<=
0
)
||
(
xdst
.
top
>=
(
int
)
This
->
currentDesc
.
Height
)
||
(
xdst
.
left
>=
(
int
)
This
->
currentDesc
.
Width
))
||
((
Src
!=
NULL
)
&&
((
xsrc
.
bottom
<=
0
)
||
(
xsrc
.
right
<=
0
)
||
(
xsrc
.
top
>=
(
int
)
Src
->
currentDesc
.
Height
)
||
(
xsrc
.
left
>=
(
int
)
Src
->
currentDesc
.
Width
))
))
{
TRACE
(
"Nothing to be done !
\n
"
);
goto
release
;
}
/* The easy case : the source-less blits.... */
if
(
Src
==
NULL
)
...
...
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