summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c
index f167bcb8aee..e60a0a5141f 100644
--- a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c
+++ b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c
@@ -1034,6 +1034,16 @@ THE SOFTWARE.
enc->lastRow > 0xFF )
return FT_THROW( Invalid_Table );
+ nencoding = (FT_ULong)( enc->lastCol - enc->firstCol + 1 ) *
+ (FT_ULong)( enc->lastRow - enc->firstRow + 1 );
+
+ if ( FT_NEW_ARRAY( enc->offset, nencoding ) )
+ goto Bail;
+
+ error = FT_Stream_EnterFrame( stream, 2 * nencoding );
+ if ( error )
+ goto Exit;
+
FT_TRACE5(( "\n" ));
defaultCharRow = enc->defaultChar >> 8;
@@ -1054,13 +1064,6 @@ THE SOFTWARE.
defaultCharCol = enc->firstCol;
}
- nencoding = (FT_ULong)( enc->lastCol - enc->firstCol + 1 ) *
- (FT_ULong)( enc->lastRow - enc->firstRow + 1 );
-
- error = FT_Stream_EnterFrame( stream, 2 * nencoding );
- if ( error )
- goto Bail;
-
/*
* FreeType mandates that glyph index 0 is the `undefined glyph', which
* PCF calls the `default character'. However, FreeType needs glyph
@@ -1106,9 +1109,6 @@ THE SOFTWARE.
/* copy metrics of default character to index 0 */
face->metrics[0] = face->metrics[defaultCharEncodingOffset];
- if ( FT_QNEW_ARRAY( enc->offset, nencoding ) )
- goto Bail;
-
/* now loop over all values */
offset = enc->offset;
for ( i = enc->firstRow; i <= enc->lastRow; i++ )
@@ -1131,6 +1131,11 @@ THE SOFTWARE.
}
FT_Stream_ExitFrame( stream );
+ return error;
+
+ Exit:
+ FT_FREE( enc->offset );
+
Bail:
return error;
}