From 89d64fa6e3c9d7ab1b64e3e1c7c96533f5266510 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 17 May 2008 20:06:13 +0000 Subject: [PATCH] * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle zero-contour glyphs correctly. Patch from Savannah bug #23277. --- ChangeLog | 5 +++++ src/truetype/ttgload.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0892bd0a9..33b02ff2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-17 Sam Hocevar + + * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle zero-contour + glyphs correctly. Patch from Savannah bug #23277. + 2008-05-16 Werner Lemberg * docs/CHANGES: Updated. diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 77b3fdd96..8f1c61b77 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -267,7 +267,11 @@ if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit ) goto Invalid_Outline; - cont[0] = prev_cont = FT_NEXT_USHORT( p ); + prev_cont = FT_NEXT_USHORT( p ); + + if ( n_contours > 0 ) + cont[0] = prev_cont; + for ( cont++; cont < cont_limit; cont++ ) { cont[0] = FT_NEXT_USHORT( p );