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
78846236
Commit
78846236
authored
Jul 16, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Filter out unusable ranges on AddMapping().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
1cf2ac20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
analyzer.c
dlls/dwrite/analyzer.c
+17
-3
No files found.
dlls/dwrite/analyzer.c
View file @
78846236
...
...
@@ -2374,7 +2374,7 @@ static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder
{
struct
dwrite_fontfallback_builder
*
builder
=
impl_from_IDWriteFontFallbackBuilder
(
iface
);
struct
fallback_mapping
*
mapping
;
UINT32
i
;
unsigned
int
i
,
count
;
TRACE
(
"%p, %p, %u, %p, %u, %p, %s, %s, %f.
\n
"
,
iface
,
ranges
,
ranges_count
,
families
,
families_count
,
collection
,
debugstr_w
(
locale_name
),
debugstr_w
(
base_family
),
scale
);
...
...
@@ -2397,8 +2397,22 @@ static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder
if
(
!
(
mapping
->
ranges
=
calloc
(
ranges_count
,
sizeof
(
*
mapping
->
ranges
))))
goto
failed
;
mapping
->
ranges_count
=
ranges_count
;
memcpy
(
mapping
->
ranges
,
ranges
,
sizeof
(
*
mapping
->
ranges
)
*
ranges_count
);
/* Filter ranges that won't be usable. */
for
(
i
=
0
,
count
=
0
;
i
<
ranges_count
;
++
i
)
{
if
(
ranges
[
i
].
first
>
ranges
[
i
].
last
)
continue
;
if
(
ranges
[
i
].
first
>
0x10ffff
)
continue
;
mapping
->
ranges
[
count
].
first
=
ranges
[
i
].
first
;
mapping
->
ranges
[
count
].
last
=
min
(
ranges
[
i
].
last
,
0x10ffff
);
count
++
;
}
if
(
!
count
)
{
release_fallback_mapping
(
mapping
);
return
S_OK
;
}
mapping
->
ranges_count
=
count
;
if
(
!
(
mapping
->
families
=
calloc
(
families_count
,
sizeof
(
*
mapping
->
families
))))
goto
failed
;
...
...
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