From 41bd254198b8b879a562a85f7dc868c3c0f7fbc1 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 12 Mar 2012 10:33:22 +0100 Subject: Updated to freetype-2.4.9 --- freetype/src/truetype/ttgload.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'freetype/src/truetype/ttgload.c') diff --git a/freetype/src/truetype/ttgload.c b/freetype/src/truetype/ttgload.c index f35521e17..ce8c8887b 100644 --- a/freetype/src/truetype/ttgload.c +++ b/freetype/src/truetype/ttgload.c @@ -4,7 +4,7 @@ /* */ /* TrueType Glyph Loader (body). */ /* */ -/* Copyright 1996-2011 */ +/* Copyright 1996-2012 */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -362,19 +362,21 @@ if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit ) goto Invalid_Outline; - prev_cont = FT_NEXT_USHORT( p ); + prev_cont = FT_NEXT_SHORT( p ); if ( n_contours > 0 ) cont[0] = prev_cont; + if ( prev_cont < 0 ) + goto Invalid_Outline; + for ( cont++; cont < cont_limit; cont++ ) { - cont[0] = FT_NEXT_USHORT( p ); + cont[0] = FT_NEXT_SHORT( p ); if ( cont[0] <= prev_cont ) { /* unordered contours: this is invalid */ - error = TT_Err_Invalid_Table; - goto Fail; + goto Invalid_Outline; } prev_cont = cont[0]; } @@ -392,13 +394,6 @@ if ( error ) goto Fail; - /* we'd better check the contours table right now */ - outline = &gloader->current.outline; - - for ( cont = outline->contours + 1; cont < cont_limit; cont++ ) - if ( cont[-1] >= cont[0] ) - goto Invalid_Outline; - /* reading the bytecode instructions */ load->glyph->control_len = 0; load->glyph->control_data = 0; @@ -439,6 +434,8 @@ p += n_ins; + outline = &gloader->current.outline; + /* reading the point tags */ flag = (FT_Byte*)outline->tags; flag_limit = flag + n_points; -- cgit v1.2.3