Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
ec95f9c9
by Alexei Podtelezhnikov at 2021-05-02T18:30:22-04:00
3 changed files:
Changes:
1 |
+2021-04-25 Alexei Podtelezhnikov <apodtele@gmail.com>
|
|
2 |
+ |
|
3 |
+ [bdf,pcf] Avoid memory zeroing (contd.).
|
|
4 |
+ |
|
5 |
+ * src/bdf/bdflib.c (bdf_create_property, _bdf_add_comment,
|
|
6 |
+ _bdf_add_property, bdf_load_font): Tweak allocation macros.
|
|
7 |
+ * src/pcf/pcfread.c (pcf_get_properties, pcf_get_metrics): Ditto.
|
|
8 |
+ |
|
1 | 9 |
2021-05-01 Alexei Podtelezhnikov <apodtele@gmail.com>
|
2 | 10 |
|
3 | 11 |
* src/cid/cidload.c (cid_read_subrs): Tweak allocaton macro.
|
... | ... | @@ -844,9 +844,9 @@ |
844 | 844 |
if ( ft_hash_str_lookup( name, &(font->proptbl) ) )
|
845 | 845 |
goto Exit;
|
846 | 846 |
|
847 |
- if ( FT_RENEW_ARRAY( font->user_props,
|
|
848 |
- font->nuser_props,
|
|
849 |
- font->nuser_props + 1 ) )
|
|
847 |
+ if ( FT_QRENEW_ARRAY( font->user_props,
|
|
848 |
+ font->nuser_props,
|
|
849 |
+ font->nuser_props + 1 ) )
|
|
850 | 850 |
goto Exit;
|
851 | 851 |
|
852 | 852 |
p = font->user_props + font->nuser_props;
|
... | ... | @@ -941,9 +941,9 @@ |
941 | 941 |
FT_Error error = FT_Err_Ok;
|
942 | 942 |
|
943 | 943 |
|
944 |
- if ( FT_RENEW_ARRAY( font->comments,
|
|
945 |
- font->comments_len,
|
|
946 |
- font->comments_len + len + 1 ) )
|
|
944 |
+ if ( FT_QRENEW_ARRAY( font->comments,
|
|
945 |
+ font->comments_len,
|
|
946 |
+ font->comments_len + len + 1 ) )
|
|
947 | 947 |
goto Exit;
|
948 | 948 |
|
949 | 949 |
cp = font->comments + font->comments_len;
|
... | ... | @@ -1158,9 +1158,9 @@ |
1158 | 1158 |
/* Allocate another property if this is overflowing. */
|
1159 | 1159 |
if ( font->props_used == font->props_size )
|
1160 | 1160 |
{
|
1161 |
- if ( FT_RENEW_ARRAY( font->props,
|
|
1162 |
- font->props_size,
|
|
1163 |
- font->props_size + 1 ) )
|
|
1161 |
+ if ( FT_QRENEW_ARRAY( font->props,
|
|
1162 |
+ font->props_size,
|
|
1163 |
+ font->props_size + 1 ) )
|
|
1164 | 1164 |
goto Exit;
|
1165 | 1165 |
|
1166 | 1166 |
fp = font->props + font->props_size;
|
... | ... | @@ -2279,9 +2279,9 @@ |
2279 | 2279 |
|
2280 | 2280 |
if ( p->font->comments_len > 0 )
|
2281 | 2281 |
{
|
2282 |
- if ( FT_RENEW_ARRAY( p->font->comments,
|
|
2283 |
- p->font->comments_len,
|
|
2284 |
- p->font->comments_len + 1 ) )
|
|
2282 |
+ if ( FT_QRENEW_ARRAY( p->font->comments,
|
|
2283 |
+ p->font->comments_len,
|
|
2284 |
+ p->font->comments_len + 1 ) )
|
|
2285 | 2285 |
goto Fail;
|
2286 | 2286 |
|
2287 | 2287 |
p->font->comments[p->font->comments_len] = 0;
|
... | ... | @@ -613,7 +613,7 @@ THE SOFTWARE. |
613 | 613 |
|
614 | 614 |
strings[string_size] = '\0';
|
615 | 615 |
|
616 |
- if ( FT_NEW_ARRAY( properties, nprops ) )
|
|
616 |
+ if ( FT_QNEW_ARRAY( properties, nprops ) )
|
|
617 | 617 |
goto Bail;
|
618 | 618 |
|
619 | 619 |
face->properties = properties;
|
... | ... | @@ -766,7 +766,7 @@ THE SOFTWARE. |
766 | 766 |
|
767 | 767 |
face->nmetrics = nmetrics + 1;
|
768 | 768 |
|
769 |
- if ( FT_NEW_ARRAY( face->metrics, face->nmetrics ) )
|
|
769 |
+ if ( FT_QNEW_ARRAY( face->metrics, face->nmetrics ) )
|
|
770 | 770 |
return error;
|
771 | 771 |
|
772 | 772 |
/* we handle glyph index 0 later on */
|