Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
6ada59ab
by Alexei Podtelezhnikov at 2021-04-23T19:22:51-04:00
5 changed files:
Changes:
1 |
+2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com>
|
|
2 |
+ |
|
3 |
+ [sfnt] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
|
|
4 |
+ |
|
5 |
+ * src/sfnt/sfdriver.c (get_win_string, get_apple_string,
|
|
6 |
+ sfnt_get_var_ps_name): Do not zero out the buffer.
|
|
7 |
+ * src/sfnt/sfobjs.c (sfnt_init_face): Ditto.
|
|
8 |
+ * src/sfnt/sfwoff.c (woff_open_font): Ditto.
|
|
9 |
+ * src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
|
|
10 |
+ |
|
1 | 11 |
2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com>
|
2 | 12 |
|
3 | 13 |
[cff,type1,type42] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
|
... | ... | @@ -501,7 +501,7 @@ |
501 | 501 |
FT_UNUSED( error );
|
502 | 502 |
|
503 | 503 |
|
504 |
- if ( FT_ALLOC( result, entry->stringLength / 2 + 1 ) )
|
|
504 |
+ if ( FT_QALLOC( result, entry->stringLength / 2 + 1 ) )
|
|
505 | 505 |
return NULL;
|
506 | 506 |
|
507 | 507 |
if ( FT_STREAM_SEEK( entry->stringOffset ) ||
|
... | ... | @@ -560,7 +560,7 @@ |
560 | 560 |
FT_UNUSED( error );
|
561 | 561 |
|
562 | 562 |
|
563 |
- if ( FT_ALLOC( result, entry->stringLength + 1 ) )
|
|
563 |
+ if ( FT_QALLOC( result, entry->stringLength + 1 ) )
|
|
564 | 564 |
return NULL;
|
565 | 565 |
|
566 | 566 |
if ( FT_STREAM_SEEK( entry->stringOffset ) ||
|
... | ... | @@ -928,8 +928,8 @@ |
928 | 928 |
|
929 | 929 |
/* after the prefix we have character `-' followed by the */
|
930 | 930 |
/* subfamily name (using only characters a-z, A-Z, and 0-9) */
|
931 |
- if ( FT_ALLOC( result, face->var_postscript_prefix_len +
|
|
932 |
- 1 + ft_strlen( subfamily_name ) + 1 ) )
|
|
931 |
+ if ( FT_QALLOC( result, face->var_postscript_prefix_len +
|
|
932 |
+ 1 + ft_strlen( subfamily_name ) + 1 ) )
|
|
933 | 933 |
return NULL;
|
934 | 934 |
|
935 | 935 |
ft_strcpy( result, face->var_postscript_prefix );
|
... | ... | @@ -957,9 +957,9 @@ |
957 | 957 |
construct_instance_name:
|
958 | 958 |
axis = mm_var->axis;
|
959 | 959 |
|
960 |
- if ( FT_ALLOC( result,
|
|
961 |
- face->var_postscript_prefix_len +
|
|
962 |
- num_coords * MAX_VALUE_DESCRIPTOR_LEN + 1 ) )
|
|
960 |
+ if ( FT_QALLOC( result,
|
|
961 |
+ face->var_postscript_prefix_len +
|
|
962 |
+ num_coords * MAX_VALUE_DESCRIPTOR_LEN + 1 ) )
|
|
963 | 963 |
return NULL;
|
964 | 964 |
|
965 | 965 |
p = result;
|
... | ... | @@ -993,6 +993,7 @@ |
993 | 993 |
if ( t != ' ' && ft_isalnum( t ) )
|
994 | 994 |
*p++ = t;
|
995 | 995 |
}
|
996 |
+ *p++ = '\0';
|
|
996 | 997 |
}
|
997 | 998 |
|
998 | 999 |
check_length:
|
... | ... | @@ -643,8 +643,8 @@ |
643 | 643 |
*/
|
644 | 644 |
|
645 | 645 |
if ( ( face->variation_support & TT_FACE_FLAG_VAR_FVAR ) &&
|
646 |
- !( FT_ALLOC( default_values, num_axes * 4 ) ||
|
|
647 |
- FT_ALLOC( instance_values, num_axes * 4 ) ) )
|
|
646 |
+ !( FT_QALLOC( default_values, num_axes * 4 ) ||
|
|
647 |
+ FT_QALLOC( instance_values, num_axes * 4 ) ) )
|
|
648 | 648 |
{
|
649 | 649 |
/* the current stream position is 16 bytes after the table start */
|
650 | 650 |
FT_ULong array_start = FT_STREAM_POS() - 16 + offset;
|
... | ... | @@ -160,8 +160,8 @@ |
160 | 160 |
}
|
161 | 161 |
|
162 | 162 |
/* Don't trust `totalSfntSize' before thorough checks. */
|
163 |
- if ( FT_ALLOC( sfnt, 12 + woff.num_tables * 16UL ) ||
|
|
164 |
- FT_NEW( sfnt_stream ) )
|
|
163 |
+ if ( FT_QALLOC( sfnt, 12 + woff.num_tables * 16UL ) ||
|
|
164 |
+ FT_NEW( sfnt_stream ) )
|
|
165 | 165 |
goto Exit;
|
166 | 166 |
|
167 | 167 |
sfnt_header = sfnt;
|
... | ... | @@ -2174,8 +2174,8 @@ |
2174 | 2174 |
}
|
2175 | 2175 |
|
2176 | 2176 |
/* Write sfnt header. */
|
2177 |
- if ( FT_ALLOC( sfnt, sfnt_size ) ||
|
|
2178 |
- FT_NEW( sfnt_stream ) )
|
|
2177 |
+ if ( FT_QALLOC( sfnt, sfnt_size ) ||
|
|
2178 |
+ FT_NEW( sfnt_stream ) )
|
|
2179 | 2179 |
goto Exit;
|
2180 | 2180 |
|
2181 | 2181 |
sfnt_header = sfnt;
|
... | ... | @@ -2246,8 +2246,8 @@ |
2246 | 2246 |
}
|
2247 | 2247 |
|
2248 | 2248 |
/* Allocate memory for uncompressed table data. */
|
2249 |
- if ( FT_ALLOC( uncompressed_buf, woff2.uncompressed_size ) ||
|
|
2250 |
- FT_FRAME_ENTER( woff2.totalCompressedSize ) )
|
|
2249 |
+ if ( FT_QALLOC( uncompressed_buf, woff2.uncompressed_size ) ||
|
|
2250 |
+ FT_FRAME_ENTER( woff2.totalCompressedSize ) )
|
|
2251 | 2251 |
goto Exit;
|
2252 | 2252 |
|
2253 | 2253 |
/* Uncompress the stream. */
|