Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
8150ed0d
by Alexei Podtelezhnikov at 2021-05-05T23:30:46-04:00
4 changed files:
Changes:
1 |
+2021-05-05 Alexei Podtelezhnikov <apodtele@gmail.com>
|
|
2 |
+ |
|
3 |
+ [cff,psaux] Avoid memory zeroing (contd.).
|
|
4 |
+ |
|
5 |
+ * src/cff/cffload.c (cff_blend_doBlend, cff_blend_build_vector): Tweak
|
|
6 |
+ allocation macros.
|
|
7 |
+ * src/psaux/psarrst.c (cf2_arrstack_setNumElements): Ditto.
|
|
8 |
+ * src/psaux/psstack.c (cf2_stack_init): Ditto.
|
|
9 |
+ |
|
1 | 10 |
2021-05-04 Ben Wagner <bungeman@chromium.org>
|
2 | 11 |
|
3 | 12 |
* src/cid/cidload.c (cid_hex_to_binary): Improve return value.
|
... | ... | @@ -1320,9 +1320,9 @@ |
1320 | 1320 |
|
1321 | 1321 |
/* increase or allocate `blend_stack' and reset `blend_top'; */
|
1322 | 1322 |
/* prepare to append `numBlends' values to the buffer */
|
1323 |
- if ( FT_REALLOC( subFont->blend_stack,
|
|
1324 |
- subFont->blend_alloc,
|
|
1325 |
- subFont->blend_alloc + size ) )
|
|
1323 |
+ if ( FT_QREALLOC( subFont->blend_stack,
|
|
1324 |
+ subFont->blend_alloc,
|
|
1325 |
+ subFont->blend_alloc + size ) )
|
|
1326 | 1326 |
goto Exit;
|
1327 | 1327 |
|
1328 | 1328 |
subFont->blend_top = subFont->blend_stack + subFont->blend_used;
|
... | ... | @@ -1435,9 +1435,7 @@ |
1435 | 1435 |
|
1436 | 1436 |
/* prepare buffer for the blend vector */
|
1437 | 1437 |
len = varData->regionIdxCount + 1; /* add 1 for default component */
|
1438 |
- if ( FT_REALLOC( blend->BV,
|
|
1439 |
- blend->lenBV * sizeof( *blend->BV ),
|
|
1440 |
- len * sizeof( *blend->BV ) ) )
|
|
1438 |
+ if ( FT_QRENEW_ARRAY( blend->BV, blend->lenBV, len ) )
|
|
1441 | 1439 |
goto Exit;
|
1442 | 1440 |
|
1443 | 1441 |
blend->lenBV = len;
|
... | ... | @@ -1539,9 +1537,7 @@ |
1539 | 1537 |
if ( lenNDV != 0 )
|
1540 | 1538 |
{
|
1541 | 1539 |
/* user has set a normalized vector */
|
1542 |
- if ( FT_REALLOC( blend->lastNDV,
|
|
1543 |
- blend->lenNDV * sizeof ( *NDV ),
|
|
1544 |
- lenNDV * sizeof ( *NDV ) ) )
|
|
1540 |
+ if ( FT_QRENEW_ARRAY( blend->lastNDV, blend->lenNDV, lenNDV ) )
|
|
1545 | 1541 |
goto Exit;
|
1546 | 1542 |
|
1547 | 1543 |
FT_MEM_COPY( blend->lastNDV,
|
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 |
|
111 | 111 |
FT_ASSERT( newSize > 0 ); /* avoid realloc with zero size */
|
112 | 112 |
|
113 |
- if ( !FT_REALLOC( arrstack->ptr, arrstack->totalSize, newSize ) )
|
|
113 |
+ if ( !FT_QREALLOC( arrstack->ptr, arrstack->totalSize, newSize ) )
|
|
114 | 114 |
{
|
115 | 115 |
arrstack->allocated = numElements;
|
116 | 116 |
arrstack->totalSize = newSize;
|
... | ... | @@ -59,10 +59,9 @@ |
59 | 59 |
CF2_Stack stack = NULL;
|
60 | 60 |
|
61 | 61 |
|
62 |
- if ( FT_NEW( stack ) )
|
|
62 |
+ if ( FT_QNEW( stack ) )
|
|
63 | 63 |
return NULL;
|
64 | 64 |
|
65 |
- /* initialize the structure; FT_NEW zeroes it */
|
|
66 | 65 |
stack->memory = memory;
|
67 | 66 |
stack->error = e;
|
68 | 67 |
|