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
7b48db19
Commit
7b48db19
authored
May 03, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
May 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d: Fix the surface locking rectangle validation.
parent
1fca7ecc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
22 deletions
+30
-22
surface.c
dlls/d3d8/surface.c
+16
-0
surface.c
dlls/ddraw/surface.c
+14
-0
surface.c
dlls/wined3d/surface.c
+0
-11
surface_gdi.c
dlls/wined3d/surface_gdi.c
+0
-11
No files found.
dlls/d3d8/surface.c
View file @
7b48db19
...
...
@@ -147,6 +147,22 @@ static HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D
IDirect3DSurface8Impl
*
This
=
(
IDirect3DSurface8Impl
*
)
iface
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
TRACE
(
"(%p) calling IWineD3DSurface_LockRect %p %p %p %d
\n
"
,
This
,
This
->
wineD3DSurface
,
pLockedRect
,
pRect
,
Flags
);
if
(
pRect
)
{
D3DSURFACE_DESC
desc
;
IDirect3DSurface8_GetDesc
(
iface
,
&
desc
);
if
((
pRect
->
left
<
0
)
||
(
pRect
->
top
<
0
)
||
(
pRect
->
left
>=
pRect
->
right
)
||
(
pRect
->
top
>=
pRect
->
bottom
)
||
(
pRect
->
right
>
desc
.
Width
)
||
(
pRect
->
bottom
>
desc
.
Height
))
{
WARN
(
"Trying to lock an invalid rectangle, returning D3DERR_INVALIDCALL
\n
"
);
return
D3DERR_INVALIDCALL
;
}
}
return
IWineD3DSurface_LockRect
(
This
->
wineD3DSurface
,
(
WINED3DLOCKED_RECT
*
)
pLockedRect
,
pRect
,
Flags
);
}
...
...
dlls/ddraw/surface.c
View file @
7b48db19
...
...
@@ -549,6 +549,20 @@ IDirectDrawSurfaceImpl_Lock(IDirectDrawSurface7 *iface,
HRESULT
hr
;
TRACE
(
"(%p)->(%p,%p,%x,%p)
\n
"
,
This
,
Rect
,
DDSD
,
Flags
,
h
);
if
(
Rect
)
{
if
((
Rect
->
left
<
0
)
||
(
Rect
->
top
<
0
)
||
(
Rect
->
left
>
Rect
->
right
)
||
(
Rect
->
top
>
Rect
->
bottom
)
||
(
Rect
->
right
>
This
->
surface_desc
.
dwWidth
)
||
(
Rect
->
bottom
>
This
->
surface_desc
.
dwHeight
))
{
WARN
(
"Trying to lock an invalid rectangle, returning DDERR_INVALIDPARAMS
\n
"
);
return
DDERR_INVALIDPARAMS
;
}
}
if
(
!
DDSD
)
return
DDERR_INVALIDPARAMS
;
...
...
dlls/wined3d/surface.c
View file @
7b48db19
...
...
@@ -720,17 +720,6 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
}
else
{
TRACE
(
"Lock Rect (%p) = l %d, t %d, r %d, b %d
\n
"
,
pRect
,
pRect
->
left
,
pRect
->
top
,
pRect
->
right
,
pRect
->
bottom
);
if
((
pRect
->
top
<
0
)
||
(
pRect
->
left
<
0
)
||
(
pRect
->
left
>=
pRect
->
right
)
||
(
pRect
->
top
>=
pRect
->
bottom
)
||
(
pRect
->
right
>
This
->
currentDesc
.
Width
)
||
(
pRect
->
bottom
>
This
->
currentDesc
.
Height
))
{
WARN
(
" Invalid values in pRect !!!
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
/* DXTn textures are based on compressed blocks of 4x4 pixels, each
* 16 bytes large (8 bytes in case of DXT1). Because of that Pitch has
* slightly different meaning compared to regular textures. For DXTn
...
...
dlls/wined3d/surface_gdi.c
View file @
7b48db19
...
...
@@ -209,17 +209,6 @@ IWineGDISurfaceImpl_LockRect(IWineD3DSurface *iface,
TRACE
(
"Lock Rect (%p) = l %d, t %d, r %d, b %d
\n
"
,
pRect
,
pRect
->
left
,
pRect
->
top
,
pRect
->
right
,
pRect
->
bottom
);
if
((
pRect
->
top
<
0
)
||
(
pRect
->
left
<
0
)
||
(
pRect
->
left
>=
pRect
->
right
)
||
(
pRect
->
top
>=
pRect
->
bottom
)
||
(
pRect
->
right
>
This
->
currentDesc
.
Width
)
||
(
pRect
->
bottom
>
This
->
currentDesc
.
Height
))
{
WARN
(
" Invalid values in pRect !!!
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
if
(
This
->
resource
.
format
==
WINED3DFMT_DXT1
)
{
/* DXT1 is half byte per pixel */
...
...
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