Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
f631542d
by Alexei Podtelezhnikov at 2021-04-27T11:39:58-04:00
2 changed files:
Changes:
1 |
+2021-04-27 Alexei Podtelezhnikov <apodtele@gmail.com>
|
|
2 |
+ |
|
3 |
+ [lzw] Preserve decompression stack when relocating to heap.
|
|
4 |
+ |
|
5 |
+ * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Copy stack when
|
|
6 |
+ relocating to heap.
|
|
7 |
+ |
|
1 | 8 |
2021-04-27 Alexei Podtelezhnikov <apodtele@gmail.com>
|
2 | 9 |
|
3 | 10 |
* src/cid/cidgload.c (cid_load_glyph): Restore the glyph_length check.
|
... | ... | @@ -127,6 +127,7 @@ |
127 | 127 |
|
128 | 128 |
new_size = new_size + ( new_size >> 1 ) + 4;
|
129 | 129 |
|
130 |
+ /* if relocating to heap */
|
|
130 | 131 |
if ( state->stack == state->stack_0 )
|
131 | 132 |
{
|
132 | 133 |
state->stack = NULL;
|
... | ... | @@ -142,9 +143,13 @@ |
142 | 143 |
return -1;
|
143 | 144 |
}
|
144 | 145 |
|
145 |
- if ( FT_RENEW_ARRAY( state->stack, old_size, new_size ) ) |
|
146 |
+ if ( FT_QRENEW_ARRAY( state->stack, old_size, new_size ) )
|
|
146 | 147 |
return -1;
|
147 | 148 |
|
149 |
+ /* if relocating to heap */
|
|
150 |
+ if ( old_size == 0 )
|
|
151 |
+ FT_MEM_COPY( state->stack, state->stack_0, FT_LZW_DEFAULT_STACK_SIZE );
|
|
152 |
+ |
|
148 | 153 |
state->stack_size = new_size;
|
149 | 154 |
}
|
150 | 155 |
return 0;
|