diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/cid/cidload.c')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/src/cid/cidload.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/cid/cidload.c b/Build/source/libs/freetype2/freetype-src/src/cid/cidload.c index 7fd0d7c78c2..bb9136a3df8 100644 --- a/Build/source/libs/freetype2/freetype-src/src/cid/cidload.c +++ b/Build/source/libs/freetype2/freetype-src/src/cid/cidload.c @@ -4,7 +4,7 @@ * * CID-keyed Type1 font loader (body). * - * Copyright (C) 1996-2021 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -552,7 +552,7 @@ goto Fail; } - if ( FT_QRENEW_ARRAY( offsets, max_offsets, new_max ) ) + if ( FT_RENEW_ARRAY( offsets, max_offsets, new_max ) ) goto Fail; max_offsets = new_max; @@ -589,8 +589,8 @@ /* allocate, and read them */ data_len = offsets[num_subrs] - offsets[0]; - if ( FT_QNEW_ARRAY( subr->code, num_subrs + 1 ) || - FT_QALLOC( subr->code[0], data_len ) ) + if ( FT_NEW_ARRAY( subr->code, num_subrs + 1 ) || + FT_ALLOC( subr->code[0], data_len ) ) goto Fail; if ( FT_STREAM_SEEK( cid->data_offset + offsets[0] ) || @@ -665,18 +665,17 @@ static FT_Error - cid_hex_to_binary( FT_Byte* data, - FT_ULong data_len, - FT_ULong offset, - CID_Face face, - FT_ULong* data_written ) + cid_hex_to_binary( FT_Byte* data, + FT_ULong data_len, + FT_ULong offset, + CID_Face face ) { FT_Stream stream = face->root.stream; FT_Error error; FT_Byte buffer[256]; FT_Byte *p, *plimit; - FT_Byte *d = data, *dlimit; + FT_Byte *d, *dlimit; FT_Byte val; FT_Bool upper_nibble, done; @@ -685,6 +684,7 @@ if ( FT_STREAM_SEEK( offset ) ) goto Exit; + d = data; dlimit = d + data_len; p = buffer; plimit = p; @@ -758,7 +758,6 @@ error = FT_Err_Ok; Exit: - *data_written = (FT_ULong)( d - data ); return error; } @@ -804,8 +803,8 @@ if ( parser->binary_length > face->root.stream->size - parser->data_offset ) { - FT_TRACE0(( "cid_face_open: adjusting length of binary data\n" )); - FT_TRACE0(( " (from %ld to %ld bytes)\n", + FT_TRACE0(( "cid_face_open: adjusting length of binary data\n" + " (from %ld to %ld bytes)\n", parser->binary_length, face->root.stream->size - parser->data_offset )); parser->binary_length = face->root.stream->size - @@ -813,16 +812,15 @@ } /* we must convert the data section from hexadecimal to binary */ - if ( FT_QALLOC( face->binary_data, parser->binary_length ) || + if ( FT_ALLOC( face->binary_data, parser->binary_length ) || FT_SET_ERROR( cid_hex_to_binary( face->binary_data, parser->binary_length, parser->data_offset, - face, - &binary_length ) ) ) + face ) ) ) goto Exit; FT_Stream_OpenMemory( face->cid_stream, - face->binary_data, binary_length ); + face->binary_data, parser->binary_length ); cid->data_offset = 0; } else @@ -845,8 +843,8 @@ if ( cid->fd_bytes > 4 || cid->gd_bytes > 4 ) { FT_ERROR(( "cid_face_open:" - " Values of `FDBytes' or `GDBytes' larger than 4\n" )); - FT_ERROR(( " " + " Values of `FDBytes' or `GDBytes' larger than 4\n" + " " " are not supported\n" )); error = FT_THROW( Invalid_File_Format ); goto Exit; |