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
2dd90388
Commit
2dd90388
authored
Aug 03, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Fix stretch value validation in CreateTextFormat().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
27cdb54b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
format.c
dlls/dwrite/format.c
+7
-4
layout.c
dlls/dwrite/tests/layout.c
+4
-0
No files found.
dlls/dwrite/format.c
View file @
2dd90388
/*
* Copyright 2012, 2014-202
1
Nikolay Sivov for CodeWeavers
* Copyright 2012, 2014-202
2
Nikolay Sivov for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -723,10 +723,13 @@ HRESULT create_text_format(const WCHAR *family_name, IDWriteFontCollection *coll
if
(
size
<=
0
.
0
f
)
return
E_INVALIDARG
;
if
(((
UINT32
)
weight
>
DWRITE_FONT_WEIGHT_ULTRA_BLACK
)
||
((
UINT32
)
stretch
>
DWRITE_FONT_STRETCH_ULTRA_EXPANDED
)
||
((
UINT32
)
style
>
DWRITE_FONT_STYLE_ITALIC
))
if
((
UINT32
)
weight
>
DWRITE_FONT_WEIGHT_ULTRA_BLACK
||
stretch
==
DWRITE_FONT_STRETCH_UNDEFINED
||
(
UINT32
)
stretch
>
DWRITE_FONT_STRETCH_ULTRA_EXPANDED
||
(
UINT32
)
style
>
DWRITE_FONT_STYLE_ITALIC
)
{
return
E_INVALIDARG
;
}
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
...
...
dlls/dwrite/tests/layout.c
View file @
2dd90388
...
...
@@ -1196,6 +1196,10 @@ static void test_CreateTextFormat(void)
10
,
10
.
0
f
,
L"en-us"
,
&
format
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDWriteFactory_CreateTextFormat
(
factory
,
L"Tahoma"
,
NULL
,
DWRITE_FONT_WEIGHT_NORMAL
,
DWRITE_FONT_STYLE_ITALIC
,
DWRITE_FONT_STRETCH_UNDEFINED
,
10
.
0
f
,
L"en-us"
,
&
format
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
/* empty family name */
hr
=
IDWriteFactory_CreateTextFormat
(
factory
,
L""
,
NULL
,
DWRITE_FONT_WEIGHT_NORMAL
,
DWRITE_FONT_STYLE_NORMAL
,
DWRITE_FONT_STRETCH_NORMAL
,
10
.
0
f
,
L"en-us"
,
&
format
);
...
...
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