w32: fail gracefully when using invalid glyphs on DWrite
* src/w32dwrite.c (text_extents_internal): Return false instead of crashing with bad glyph indexes. (Bug#77196)
This commit is contained in:
parent
555ec43a32
commit
33a46ff565
1 changed files with 8 additions and 0 deletions
|
@ -610,6 +610,14 @@ text_extents_internal (IDWriteFontFace *dwrite_font_face,
|
|||
nglyphs,
|
||||
gmetrics,
|
||||
false);
|
||||
|
||||
/* E_INVALIDARG means some of the glyphs index is out of bounds for the font. */
|
||||
if (hr == E_INVALIDARG)
|
||||
{
|
||||
SAFE_FREE ();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!verify_hr (hr, "Failed to GetGdiCompatibleGlyphMetrics"))
|
||||
{
|
||||
SAFE_FREE ();
|
||||
|
|
Loading…
Add table
Reference in a new issue