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
63316d09
Commit
63316d09
authored
Nov 18, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Return DDERR_INVALIDPARAMS for 0 width / height surface creation.
parent
f683fe31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
ddraw.c
dlls/ddraw/ddraw.c
+6
-0
dsurface.c
dlls/ddraw/tests/dsurface.c
+24
-0
No files found.
dlls/ddraw/ddraw.c
View file @
63316d09
...
...
@@ -3069,6 +3069,12 @@ static HRESULT CreateSurface(IDirectDraw7 *iface,
desc2
.
dwHeight
=
Mode
.
Height
;
}
if
(
!
desc2
.
dwWidth
||
!
desc2
.
dwHeight
)
{
LeaveCriticalSection
(
&
ddraw_cs
);
return
DDERR_INVALIDPARAMS
;
}
/* Mipmap count fixes */
if
(
desc2
.
ddsCaps
.
dwCaps
&
DDSCAPS_MIPMAP
)
{
...
...
dlls/ddraw/tests/dsurface.c
View file @
63316d09
...
...
@@ -2391,6 +2391,30 @@ static void SizeTest(void)
dsurface
=
NULL
;
}
/* Test 0 height. */
memset
(
&
desc
,
0
,
sizeof
(
desc
));
desc
.
dwSize
=
sizeof
(
desc
);
desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_OFFSCREENPLAIN
;
desc
.
dwWidth
=
1
;
desc
.
dwHeight
=
0
;
ret
=
IDirectDraw_CreateSurface
(
lpDD
,
&
desc
,
&
dsurface
,
NULL
);
ok
(
ret
==
DDERR_INVALIDPARAMS
,
"Creating a 0 height surface returned %#x, expected DDERR_INVALIDPARAMS.
\n
"
,
ret
);
if
(
SUCCEEDED
(
ret
))
IDirectDrawSurface_Release
(
dsurface
);
dsurface
=
NULL
;
/* Test 0 width. */
memset
(
&
desc
,
0
,
sizeof
(
desc
));
desc
.
dwSize
=
sizeof
(
desc
);
desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_OFFSCREENPLAIN
;
desc
.
dwWidth
=
0
;
desc
.
dwHeight
=
1
;
ret
=
IDirectDraw_CreateSurface
(
lpDD
,
&
desc
,
&
dsurface
,
NULL
);
ok
(
ret
==
DDERR_INVALIDPARAMS
,
"Creating a 0 width surface returned %#x, expected DDERR_INVALIDPARAMS.
\n
"
,
ret
);
if
(
SUCCEEDED
(
ret
))
IDirectDrawSurface_Release
(
dsurface
);
dsurface
=
NULL
;
/* Sanity check */
ZeroMemory
(
&
desc
,
sizeof
(
desc
));
desc
.
dwSize
=
sizeof
(
desc
);
...
...
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