summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2023-02-02 10:38:18 +0100
committerWerner Lemberg <wl@gnu.org>2023-02-02 10:51:39 +0100
commit646cc8ef8d3956c46c245d1809e520803a1a41a0 (patch)
tree7b0ae5c43344924bf6ba99112c94299e33873fe4
parent9508811a3a5bc9a8f93da9edabb1521713a9a906 (diff)
downloadfreetype2-646cc8ef8d3956c46c245d1809e520803a1a41a0.tar.gz
* src/cff/cffgload.c (cff_slot_load): Avoid memory leak.
Fixes issue #1204.
-rw-r--r--src/cff/cffgload.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 487cc3006..cfa0aaf2b 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -488,13 +488,14 @@
decoder.builder.no_recurse =
FT_BOOL( load_flags & FT_LOAD_NO_RECURSE );
- /* now load the unscaled outline */
- error = cff_get_glyph_data( face, glyph_index,
- &charstring, &charstring_len );
+ /* this function also checks for a valid subfont index */
+ error = decoder_funcs->prepare( &decoder, size, glyph_index );
if ( error )
goto Glyph_Build_Finished;
- error = decoder_funcs->prepare( &decoder, size, glyph_index );
+ /* now load the unscaled outline */
+ error = cff_get_glyph_data( face, glyph_index,
+ &charstring, &charstring_len );
if ( error )
goto Glyph_Build_Finished;