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
9ec27408
Commit
9ec27408
authored
Jan 20, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/layout: Fail to create layouts with negative size.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9c138562
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
layout.c
dlls/dwrite/layout.c
+3
-0
layout.c
dlls/dwrite/tests/layout.c
+35
-2
No files found.
dlls/dwrite/layout.c
View file @
9ec27408
...
@@ -5207,6 +5207,9 @@ HRESULT create_textlayout(const struct textlayout_desc *desc, IDWriteTextLayout
...
@@ -5207,6 +5207,9 @@ HRESULT create_textlayout(const struct textlayout_desc *desc, IDWriteTextLayout
*
layout
=
NULL
;
*
layout
=
NULL
;
if
(
desc
->
max_width
<
0
.
0
f
||
desc
->
max_height
<
0
.
0
f
)
return
E_INVALIDARG
;
if
(
!
desc
->
format
||
!
desc
->
string
)
if
(
!
desc
->
format
||
!
desc
->
string
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
...
...
dlls/dwrite/tests/layout.c
View file @
9ec27408
...
@@ -908,7 +908,7 @@ static void test_CreateTextLayout(void)
...
@@ -908,7 +908,7 @@ static void test_CreateTextLayout(void)
factory
=
create_factory
();
factory
=
create_factory
();
layout
=
(
void
*
)
0xdeadbeef
;
layout
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
NULL
,
0
,
NULL
,
0
.
0
,
0
.
0
,
&
layout
);
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
NULL
,
0
,
NULL
,
0
.
0
f
,
0
.
0
f
,
&
layout
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"got %p
\n
"
,
layout
);
ok
(
layout
==
NULL
,
"got %p
\n
"
,
layout
);
...
@@ -941,6 +941,21 @@ static void test_CreateTextLayout(void)
...
@@ -941,6 +941,21 @@ static void test_CreateTextLayout(void)
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"got %p
\n
"
,
layout
);
ok
(
layout
==
NULL
,
"got %p
\n
"
,
layout
);
layout
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
L"string"
,
6
,
format
,
-
100
.
0
f
,
100
.
0
f
,
&
layout
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"Unexpected pointer %p.
\n
"
,
layout
);
layout
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
L"string"
,
6
,
format
,
100
.
0
f
,
-
100
.
0
f
,
&
layout
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"Unexpected pointer %p.
\n
"
,
layout
);
layout
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
L"string"
,
6
,
format
,
-
100
.
0
f
,
-
100
.
0
f
,
&
layout
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"Unexpected pointer %p.
\n
"
,
layout
);
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
L"string"
,
0
,
format
,
0
.
0
f
,
0
.
0
f
,
&
layout
);
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
L"string"
,
0
,
format
,
0
.
0
f
,
0
.
0
f
,
&
layout
);
ok
(
hr
==
S_OK
,
"Failed to create text layout, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create text layout, hr %#x.
\n
"
,
hr
);
IDWriteTextLayout_Release
(
layout
);
IDWriteTextLayout_Release
(
layout
);
...
@@ -1031,7 +1046,7 @@ static void test_CreateGdiCompatibleTextLayout(void)
...
@@ -1031,7 +1046,7 @@ static void test_CreateGdiCompatibleTextLayout(void)
factory
=
create_factory
();
factory
=
create_factory
();
layout
=
(
void
*
)
0xdeadbeef
;
layout
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateGdiCompatibleTextLayout
(
factory
,
NULL
,
0
,
NULL
,
0
.
0
,
0
.
0
,
0
.
0
,
NULL
,
FALSE
,
&
layout
);
hr
=
IDWriteFactory_CreateGdiCompatibleTextLayout
(
factory
,
NULL
,
0
,
NULL
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
NULL
,
FALSE
,
&
layout
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"got %p
\n
"
,
layout
);
ok
(
layout
==
NULL
,
"got %p
\n
"
,
layout
);
...
@@ -1070,6 +1085,24 @@ static void test_CreateGdiCompatibleTextLayout(void)
...
@@ -1070,6 +1085,24 @@ static void test_CreateGdiCompatibleTextLayout(void)
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"got %p
\n
"
,
layout
);
ok
(
layout
==
NULL
,
"got %p
\n
"
,
layout
);
layout
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateGdiCompatibleTextLayout
(
factory
,
L"string"
,
6
,
format
,
-
100
.
0
f
,
100
.
0
f
,
1
.
0
f
,
NULL
,
FALSE
,
&
layout
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"Unexpected pointer %p.
\n
"
,
layout
);
layout
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateGdiCompatibleTextLayout
(
factory
,
L"string"
,
6
,
format
,
100
.
0
f
,
-
100
.
0
f
,
1
.
0
f
,
NULL
,
FALSE
,
&
layout
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"Unexpected pointer %p.
\n
"
,
layout
);
layout
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateGdiCompatibleTextLayout
(
factory
,
L"string"
,
6
,
format
,
-
100
.
0
f
,
-
100
.
0
f
,
1
.
0
f
,
NULL
,
FALSE
,
&
layout
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
layout
==
NULL
,
"Unexpected pointer %p.
\n
"
,
layout
);
hr
=
IDWriteFactory_CreateGdiCompatibleTextLayout
(
factory
,
L"string"
,
6
,
format
,
100
.
0
f
,
100
.
0
f
,
1
.
0
f
,
NULL
,
hr
=
IDWriteFactory_CreateGdiCompatibleTextLayout
(
factory
,
L"string"
,
6
,
format
,
100
.
0
f
,
100
.
0
f
,
1
.
0
f
,
NULL
,
FALSE
,
&
layout
);
FALSE
,
&
layout
);
ok
(
hr
==
S_OK
,
"Failed to create text layout, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create text layout, hr %#x.
\n
"
,
hr
);
...
...
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