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
e28800c6
Commit
e28800c6
authored
Sep 29, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Move the pitch / linear size validation from ddraw_surface_init() to ddraw_surface_create().
parent
d5365aae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
surface.c
dlls/ddraw/surface.c
+17
-14
No files found.
dlls/ddraw/surface.c
View file @
e28800c6
...
...
@@ -5943,6 +5943,15 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
return
DDERR_INVALIDPARAMS
;
}
if
((
desc
->
dwFlags
&
DDSD_LINEARSIZE
)
&&
desc
->
u1
.
dwLinearSize
<
wined3d_calculate_format_pitch
(
ddraw
->
wined3d
,
WINED3DADAPTER_DEFAULT
,
wined3d_desc
.
format
,
wined3d_desc
.
width
)
*
((
desc
->
dwHeight
+
3
)
/
4
))
{
WARN
(
"Invalid linear size %u specified.
\n
"
,
desc
->
u1
.
dwLinearSize
);
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
return
DDERR_INVALIDPARAMS
;
}
}
else
{
...
...
@@ -5952,6 +5961,14 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
return
DDERR_INVALIDPARAMS
;
}
if
(
desc
->
u1
.
lPitch
<
wined3d_calculate_format_pitch
(
ddraw
->
wined3d
,
WINED3DADAPTER_DEFAULT
,
wined3d_desc
.
format
,
wined3d_desc
.
width
)
||
desc
->
u1
.
lPitch
&
3
)
{
WARN
(
"Invalid pitch %u specified.
\n
"
,
desc
->
u1
.
lPitch
);
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
return
DDERR_INVALIDPARAMS
;
}
}
}
...
...
@@ -6177,13 +6194,6 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s
{
if
(
desc
->
dwFlags
&
DDSD_LPSURFACE
)
{
if
((
desc
->
dwFlags
&
DDSD_LINEARSIZE
)
&&
desc
->
u1
.
dwLinearSize
<
wined3d_surface_get_pitch
(
wined3d_surface
)
*
((
desc
->
dwHeight
+
3
)
/
4
))
{
WARN
(
"Invalid linear size %u specified.
\n
"
,
desc
->
u1
.
dwLinearSize
);
return
DDERR_INVALIDPARAMS
;
}
if
(
FAILED
(
hr
=
wined3d_surface_update_desc
(
wined3d_surface
,
wined3d_desc
.
width
,
wined3d_desc
.
height
,
wined3d_desc
.
format
,
WINED3D_MULTISAMPLE_NONE
,
0
,
desc
->
lpSurface
,
0
)))
...
...
@@ -6207,13 +6217,6 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s
{
if
(
desc
->
dwFlags
&
DDSD_LPSURFACE
)
{
if
(
desc
->
u1
.
lPitch
<
wined3d_calculate_format_pitch
(
ddraw
->
wined3d
,
WINED3DADAPTER_DEFAULT
,
wined3d_desc
.
format
,
wined3d_desc
.
width
)
||
desc
->
u1
.
lPitch
&
3
)
{
WARN
(
"Invalid pitch %u specified.
\n
"
,
desc
->
u1
.
lPitch
);
return
DDERR_INVALIDPARAMS
;
}
if
(
FAILED
(
hr
=
wined3d_surface_update_desc
(
wined3d_surface
,
wined3d_desc
.
width
,
wined3d_desc
.
height
,
wined3d_desc
.
format
,
WINED3D_MULTISAMPLE_NONE
,
0
,
desc
->
lpSurface
,
desc
->
u1
.
lPitch
)))
...
...
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