From 02953326d4bd164da638cc62c74eefb9c1a1a938 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Thu, 16 Jan 2025 03:47:14 +0000 Subject: [PATCH] * src/bdf/bdflib.c (bdf_parse_start_): Reserve space for artificial properties. --- src/bdf/bdflib.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c index a449b88d2..66b97d3e3 100644 --- a/src/bdf/bdflib.c +++ b/src/bdf/bdflib.c @@ -1085,8 +1085,7 @@ /* First, check whether the property already exists in the font. */ - if ( font->props_used && - ( propid = ft_hash_str_lookup( name, font->internal ) ) != NULL ) + if ( ( propid = ft_hash_str_lookup( name, font->internal ) ) != NULL ) { /* The property already exists in the font, so simply replace */ /* the value of the property with the current value. */ @@ -1993,6 +1992,15 @@ goto Exit; } + /* Reserve space for artificial FONT_ASCENT or FONT_DESCENT. */ + if ( font->props_size == 0 ) + { + if ( FT_NEW_ARRAY( font->props, 2 ) ) + goto Exit; + + font->props_size = 2; + } + /* If the FONT_ASCENT or FONT_DESCENT properties have not been */ /* encountered yet, then make sure they are added as properties and */ /* make sure they are set from the font bounding box info. */