diff --git a/src/ftxgpos.c b/src/ftxgpos.c index 10267e0aef0f706d03b4b52d996858f59b377b3a..7a17e1cc55db8c6d6d77574570ef1c6d56664968 100644 --- a/src/ftxgpos.c +++ b/src/ftxgpos.c @@ -4020,9 +4020,6 @@ gdef = gpos->gdef; - if ( ALLOC_ARRAY( classes, cpf2->MaxContextLength, FT_UShort ) ) - return error; - if ( CHECK_Property( gdef, in->string[in->pos], flags, &property ) ) return error; @@ -4032,7 +4029,10 @@ error = Coverage_Index( &cpf2->Coverage, in->string[in->pos], &index ); if ( error ) - goto End; + return error; + + if ( ALLOC_ARRAY( classes, cpf2->MaxContextLength, FT_UShort ) ) + return error; error = Get_Class( &cpf2->ClassDef, in->string[in->pos], &classes[0], NULL ); diff --git a/src/ftxgsub.c b/src/ftxgsub.c index c2a59baa1ca29deb0968fa19f8f23b04dffc7823..aedc551a78a0b01bc79d2f5cafbd05f20ecf59f8 100644 --- a/src/ftxgsub.c +++ b/src/ftxgsub.c @@ -2206,9 +2206,6 @@ gdef = gsub->gdef; - if ( ALLOC_ARRAY( classes, csf2->MaxContextLength, FT_UShort ) ) - return error; - if ( CHECK_Property( gdef, in->string[in->pos], flags, &property ) ) return error; @@ -2218,7 +2215,10 @@ error = Coverage_Index( &csf2->Coverage, in->string[in->pos], &index ); if ( error ) - goto End; + return error; + + if ( ALLOC_ARRAY( classes, csf2->MaxContextLength, FT_UShort ) ) + return error; error = Get_Class( &csf2->ClassDef, in->string[in->pos], &classes[0], NULL ); @@ -3646,7 +3646,7 @@ while ( CHECK_Property( gdef, s_in[j], flags, &property ) ) { if ( error && error != TTO_Err_Not_Covered ) - return error; + goto End1; if ( j > curr_pos ) j--; @@ -3720,7 +3720,7 @@ while ( CHECK_Property( gdef, s_in[j], flags, &property ) ) { if ( error && error != TTO_Err_Not_Covered ) - return error; + goto End1; if ( curr_pos + j < in->length ) j++;