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
77448f58
Commit
77448f58
authored
Jun 29, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 30, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Perform sanity checks on the rectangle in LockRect.
parent
2abfc391
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
surface.c
dlls/wined3d/surface.c
+11
-0
surface_gdi.c
dlls/wined3d/surface_gdi.c
+11
-0
No files found.
dlls/wined3d/surface.c
View file @
77448f58
...
...
@@ -348,6 +348,17 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
}
else
{
TRACE
(
"Lock Rect (%p) = l %ld, t %ld, r %ld, b %ld
\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
D3DERR_INVALIDCALL
;
}
if
(
This
->
resource
.
format
==
WINED3DFMT_DXT1
)
{
/* DXT1 is half byte per pixel */
pLockedRect
->
pBits
=
This
->
resource
.
allocatedMemory
+
(
pLockedRect
->
Pitch
*
pRect
->
top
)
+
((
pRect
->
left
*
This
->
bytesPerPixel
/
2
));
}
else
{
...
...
dlls/wined3d/surface_gdi.c
View file @
77448f58
...
...
@@ -196,6 +196,17 @@ IWineGDISurfaceImpl_LockRect(IWineD3DSurface *iface,
TRACE
(
"Lock Rect (%p) = l %ld, t %ld, r %ld, b %ld
\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
D3DERR_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