Commit 673a28ef93a94e1cf604c38cd4db9146ead2abbb

Alexei Podtelezhnikov 2014-10-11T14:40:51

[base] Small bbox correction. * src/base/ftbbox.c (FT_Outline_Get_BBox): Start from nonsense bbox instead of initial point that could be `off' in conic outlines.

diff --git a/ChangeLog b/ChangeLog
index 85c5d85..f7f4b0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-10-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+	[base] Small bbox correction.
+
+	* src/base/ftbbox.c (FT_Outline_Get_BBox): Start from nonsense bbox
+	instead of initial point that could be `off' in conic outlines. 
+
 2014-10-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	[base] Fix Savannah bug #43356.
diff --git a/src/base/ftbbox.c b/src/base/ftbbox.c
index 91e1e81..fd3f198 100644
--- a/src/base/ftbbox.c
+++ b/src/base/ftbbox.c
@@ -433,8 +433,8 @@ FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
   FT_Outline_Get_BBox( FT_Outline*  outline,
                        FT_BBox     *abbox )
   {
-    FT_BBox     cbox;
-    FT_BBox     bbox;
+    FT_BBox     cbox = { 0x7FFFFFFF, 0x7FFFFFFF, -0x7FFFFFFF, -0x7FFFFFFF };
+    FT_BBox     bbox = { 0x7FFFFFFF, 0x7FFFFFFF, -0x7FFFFFFF, -0x7FFFFFFF };
     FT_Vector*  vec;
     FT_UShort   n;
 
@@ -458,11 +458,8 @@ FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
     /* coincide, we exit immediately.                             */
 
     vec = outline->points;
-    bbox.xMin = bbox.xMax = cbox.xMin = cbox.xMax = vec->x;
-    bbox.yMin = bbox.yMax = cbox.yMin = cbox.yMax = vec->y;
-    vec++;
 
-    for ( n = 1; n < outline->n_points; n++ )
+    for ( n = 0; n < outline->n_points; n++ )
     {
       FT_UPDATE_BBOX( vec, cbox);