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
3c415128
Commit
3c415128
authored
Jun 09, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Limit recursion level for context lookups.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7bb5b074
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
dwrite_private.h
dlls/dwrite/dwrite_private.h
+2
-0
opentype.c
dlls/dwrite/opentype.c
+10
-2
No files found.
dlls/dwrite/dwrite_private.h
View file @
3c415128
...
...
@@ -543,6 +543,8 @@ struct scriptshaping_context
unsigned
int
cur
;
unsigned
int
glyph_count
;
unsigned
int
nesting_level_left
;
float
emsize
;
DWRITE_MEASURING_MODE
measuring_mode
;
float
*
advances
;
...
...
dlls/dwrite/opentype.c
View file @
3c415128
...
...
@@ -67,6 +67,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
#define GET_BE_DWORD(x) RtlUlongByteSwap(x)
#endif
#define GLYPH_CONTEXT_MAX_LENGTH 64
#define SHAPE_MAX_NESTING_LEVEL 6
typedef
struct
{
CHAR
TTCTag
[
4
];
DWORD
Version
;
...
...
@@ -4616,6 +4619,7 @@ void opentype_layout_apply_gpos_features(struct scriptshaping_context *context,
unsigned
int
i
;
BOOL
ret
;
context
->
nesting_level_left
=
SHAPE_MAX_NESTING_LEVEL
;
context
->
u
.
buffer
.
apply_context_lookup
=
opentype_layout_apply_gpos_context_lookup
;
opentype_layout_collect_lookups
(
context
,
script_index
,
language_index
,
features
,
&
context
->
cache
->
gpos
,
&
lookups
);
...
...
@@ -4993,8 +4997,6 @@ static BOOL opentype_layout_apply_gsub_lig_substitution(struct scriptshaping_con
return
FALSE
;
}
#define GLYPH_CONTEXT_MAX_LENGTH 64
static
BOOL
opentype_layout_context_match_input
(
const
struct
match_context
*
mc
,
unsigned
int
count
,
const
UINT16
*
input
,
unsigned
int
*
end_offset
,
unsigned
int
*
match_positions
)
{
...
...
@@ -5081,6 +5083,9 @@ static BOOL opentype_layout_context_apply_lookup(struct scriptshaping_context *c
unsigned
int
i
,
j
;
int
end
,
delta
;
if
(
!
context
->
nesting_level_left
)
return
TRUE
;
end
=
context
->
cur
+
match_length
;
for
(
i
=
0
;
i
<
lookup_count
;
++
i
)
...
...
@@ -5097,7 +5102,9 @@ static BOOL opentype_layout_context_apply_lookup(struct scriptshaping_context *c
lookup_index
=
GET_BE_WORD
(
lookup_records
[
i
+
1
]);
--
context
->
nesting_level_left
;
context
->
u
.
buffer
.
apply_context_lookup
(
context
,
lookup_index
);
++
context
->
nesting_level_left
;
delta
=
context
->
glyph_count
-
orig_len
;
if
(
!
delta
)
...
...
@@ -5692,6 +5699,7 @@ void opentype_layout_apply_gsub_features(struct scriptshaping_context *context,
unsigned
int
i
;
BOOL
ret
;
context
->
nesting_level_left
=
SHAPE_MAX_NESTING_LEVEL
;
context
->
u
.
buffer
.
apply_context_lookup
=
opentype_layout_apply_gsub_context_lookup
;
opentype_layout_collect_lookups
(
context
,
script_index
,
language_index
,
features
,
context
->
table
,
&
lookups
);
...
...
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