Commit 9290fa9022c29c616ea783dc1028aad1ea92f2ee

Werner Lemberg 2012-02-29T17:29:07

[truetype] Remove redundant check. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove reduntant second check for ordered contour start points.

diff --git a/ChangeLog b/ChangeLog
index 618700d..ae817b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-02-29  Werner Lemberg  <wl@gnu.org>
 
+	[truetype] Remove redundant check.
+
+	* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove reduntant
+	second check for ordered contour start points.
+
+2012-02-29  Werner Lemberg  <wl@gnu.org>
+
 	[truetype] Make SHC instruction behave similar to MS rasterizer.
 
 	* src/truetype/ttinterp.c (Ins_SHC): Handle virtual contour in
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index f35521e..fb801d0 100644
--- a/src/truetype/ttgload.c
+++ b/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,       */
@@ -373,8 +373,7 @@
       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 +391,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 +431,8 @@
 
     p += n_ins;
 
+    outline = &gloader->current.outline;
+
     /* reading the point tags */
     flag       = (FT_Byte*)outline->tags;
     flag_limit = flag + n_points;