[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.
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
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);