]> granicus.if.org Git - libass/commitdiff
Fix off-by-one error in cbox calculation
authorGrigori Goronzy <greg@blackbox>
Mon, 7 Jun 2010 18:21:41 +0000 (20:21 +0200)
committerGrigori Goronzy <greg@blackbox>
Mon, 7 Jun 2010 18:21:41 +0000 (20:21 +0200)
The last point wasn't included in cbox calculation, sometimes triggering
removal of inside contours when it wasn't needed.

libass/ass_render.c

index 64e78a9d21fb3e8de93622d0e0909faf4e7e0f93..3084463dc98697bca227a13c805e1b867bb76ab2 100644 (file)
@@ -906,7 +906,7 @@ get_contour_cbox(FT_BBox *box, FT_Vector *points, int start, int end)
     box->xMax = box->yMax = INT_MIN;
     int i;
 
-    for (i = start; i < end; i++) {
+    for (i = start; i <= end; i++) {
         box->xMin = (points[i].x < box->xMin) ? points[i].x : box->xMin;
         box->xMax = (points[i].x > box->xMax) ? points[i].x : box->xMax;
         box->yMin = (points[i].y < box->yMin) ? points[i].y : box->yMin;