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
430145e4
Commit
430145e4
authored
May 11, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Check for allocation failures of glyph buffers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
762afeaa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
analyzer.c
dlls/dwrite/analyzer.c
+26
-4
No files found.
dlls/dwrite/analyzer.c
View file @
430145e4
...
@@ -1190,6 +1190,12 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphs(IDWriteTextAnalyzer2 *iface,
...
@@ -1190,6 +1190,12 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphs(IDWriteTextAnalyzer2 *iface,
*
actual_glyph_count
=
0
;
*
actual_glyph_count
=
0
;
if
(
!
context
.
u
.
subst
.
glyphs
||
!
context
.
u
.
subst
.
glyph_props
||
!
context
.
glyph_infos
)
{
hr
=
E_OUTOFMEMORY
;
goto
failed
;
}
scriptprops
=
&
dwritescripts_properties
[
context
.
script
];
scriptprops
=
&
dwritescripts_properties
[
context
.
script
];
hr
=
shape_get_glyphs
(
&
context
,
scriptprops
->
scripttags
);
hr
=
shape_get_glyphs
(
&
context
,
scriptprops
->
scripttags
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
...
@@ -1199,6 +1205,7 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphs(IDWriteTextAnalyzer2 *iface,
...
@@ -1199,6 +1205,7 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphs(IDWriteTextAnalyzer2 *iface,
memcpy
(
glyph_props
,
context
.
u
.
subst
.
glyph_props
,
context
.
glyph_count
*
sizeof
(
*
glyph_props
));
memcpy
(
glyph_props
,
context
.
u
.
subst
.
glyph_props
,
context
.
glyph_count
*
sizeof
(
*
glyph_props
));
}
}
failed:
heap_free
(
context
.
u
.
subst
.
glyph_props
);
heap_free
(
context
.
u
.
subst
.
glyph_props
);
heap_free
(
context
.
u
.
subst
.
glyphs
);
heap_free
(
context
.
u
.
subst
.
glyphs
);
heap_free
(
context
.
glyph_infos
);
heap_free
(
context
.
glyph_infos
);
...
@@ -1261,12 +1268,19 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphPlacements(IDWriteTextAnalyzer2
...
@@ -1261,12 +1268,19 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphPlacements(IDWriteTextAnalyzer2
context
.
user_features
.
features
=
features
;
context
.
user_features
.
features
=
features
;
context
.
user_features
.
range_lengths
=
feature_range_lengths
;
context
.
user_features
.
range_lengths
=
feature_range_lengths
;
context
.
user_features
.
range_count
=
feature_ranges
;
context
.
user_features
.
range_count
=
feature_ranges
;
context
.
glyph_infos
=
heap_
alloc_zero
(
sizeof
(
*
context
.
glyph_infos
)
*
glyph_count
);
context
.
glyph_infos
=
heap_
calloc
(
glyph_count
,
sizeof
(
*
context
.
glyph_infos
)
);
context
.
table
=
&
context
.
cache
->
gpos
;
context
.
table
=
&
context
.
cache
->
gpos
;
if
(
!
context
.
glyph_infos
)
{
hr
=
E_OUTOFMEMORY
;
goto
failed
;
}
scriptprops
=
&
dwritescripts_properties
[
context
.
script
];
scriptprops
=
&
dwritescripts_properties
[
context
.
script
];
hr
=
shape_get_positions
(
&
context
,
scriptprops
->
scripttags
);
hr
=
shape_get_positions
(
&
context
,
scriptprops
->
scripttags
);
failed:
heap_free
(
context
.
glyph_infos
);
heap_free
(
context
.
glyph_infos
);
return
hr
;
return
hr
;
...
@@ -1331,12 +1345,19 @@ static HRESULT WINAPI dwritetextanalyzer_GetGdiCompatibleGlyphPlacements(IDWrite
...
@@ -1331,12 +1345,19 @@ static HRESULT WINAPI dwritetextanalyzer_GetGdiCompatibleGlyphPlacements(IDWrite
context
.
user_features
.
features
=
features
;
context
.
user_features
.
features
=
features
;
context
.
user_features
.
range_lengths
=
feature_range_lengths
;
context
.
user_features
.
range_lengths
=
feature_range_lengths
;
context
.
user_features
.
range_count
=
feature_ranges
;
context
.
user_features
.
range_count
=
feature_ranges
;
context
.
glyph_infos
=
heap_
alloc_zero
(
sizeof
(
*
context
.
glyph_infos
)
*
glyph_count
);
context
.
glyph_infos
=
heap_
calloc
(
glyph_count
,
sizeof
(
*
context
.
glyph_infos
)
);
context
.
table
=
&
context
.
cache
->
gpos
;
context
.
table
=
&
context
.
cache
->
gpos
;
if
(
!
context
.
glyph_infos
)
{
hr
=
E_OUTOFMEMORY
;
goto
failed
;
}
scriptprops
=
&
dwritescripts_properties
[
context
.
script
];
scriptprops
=
&
dwritescripts_properties
[
context
.
script
];
hr
=
shape_get_positions
(
&
context
,
scriptprops
->
scripttags
);
hr
=
shape_get_positions
(
&
context
,
scriptprops
->
scripttags
);
failed:
heap_free
(
context
.
glyph_infos
);
heap_free
(
context
.
glyph_infos
);
return
hr
;
return
hr
;
...
@@ -1805,7 +1826,8 @@ static HRESULT WINAPI dwritetextanalyzer2_CheckTypographicFeature(IDWriteTextAna
...
@@ -1805,7 +1826,8 @@ static HRESULT WINAPI dwritetextanalyzer2_CheckTypographicFeature(IDWriteTextAna
context
.
cache
=
fontface_get_shaping_cache
(
font_obj
);
context
.
cache
=
fontface_get_shaping_cache
(
font_obj
);
context
.
language_tag
=
get_opentype_language
(
locale
);
context
.
language_tag
=
get_opentype_language
(
locale
);
context
.
glyph_infos
=
heap_calloc
(
glyph_count
,
sizeof
(
*
context
.
glyph_infos
));
if
(
!
(
context
.
glyph_infos
=
heap_calloc
(
glyph_count
,
sizeof
(
*
context
.
glyph_infos
))))
return
E_OUTOFMEMORY
;
props
=
&
dwritescripts_properties
[
sa
.
script
];
props
=
&
dwritescripts_properties
[
sa
.
script
];
...
@@ -2355,7 +2377,7 @@ static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder
...
@@ -2355,7 +2377,7 @@ static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder
mapping
->
ranges
=
heap_calloc
(
ranges_count
,
sizeof
(
*
mapping
->
ranges
));
mapping
->
ranges
=
heap_calloc
(
ranges_count
,
sizeof
(
*
mapping
->
ranges
));
memcpy
(
mapping
->
ranges
,
ranges
,
sizeof
(
*
mapping
->
ranges
)
*
ranges_count
);
memcpy
(
mapping
->
ranges
,
ranges
,
sizeof
(
*
mapping
->
ranges
)
*
ranges_count
);
mapping
->
ranges_count
=
ranges_count
;
mapping
->
ranges_count
=
ranges_count
;
mapping
->
families
=
heap_
alloc_zero
(
sizeof
(
*
mapping
->
families
)
*
families_count
);
mapping
->
families
=
heap_
calloc
(
families_count
,
sizeof
(
*
mapping
->
families
)
);
mapping
->
families_count
=
families_count
;
mapping
->
families_count
=
families_count
;
for
(
i
=
0
;
i
<
families_count
;
i
++
)
for
(
i
=
0
;
i
<
families_count
;
i
++
)
mapping
->
families
[
i
]
=
heap_strdupW
(
target_families
[
i
]);
mapping
->
families
[
i
]
=
heap_strdupW
(
target_families
[
i
]);
...
...
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