[truetype] Remove redundant check. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove reduntant second check for ordered contour start points.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
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;