mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 06:51:01 +01:00
[Glyph] Protect against an underflow
This commit is contained in:
1 parent
c7721f7df5
commit
1cbb85dc84
1 file changed
+10
-10
+10
-10
@@ -155,17 +155,17 @@ struct Glyph
|
||||
{
|
||||
xMin = xMax = all_points[0].x;
|
||||
yMin = yMax = all_points[0].y;
|
||||
}
|
||||
|
||||
unsigned count = all_points.length - 4;
|
||||
for (unsigned i = 1; i < count; i++)
|
||||
{
|
||||
float x = all_points[i].x;
|
||||
float y = all_points[i].y;
|
||||
xMin = hb_min (xMin, x);
|
||||
xMax = hb_max (xMax, x);
|
||||
yMin = hb_min (yMin, y);
|
||||
yMax = hb_max (yMax, y);
|
||||
unsigned count = all_points.length - 4;
|
||||
for (unsigned i = 1; i < count; i++)
|
||||
{
|
||||
float x = all_points[i].x;
|
||||
float y = all_points[i].y;
|
||||
xMin = hb_min (xMin, x);
|
||||
xMax = hb_max (xMax, x);
|
||||
yMin = hb_min (yMin, y);
|
||||
yMax = hb_max (yMax, y);
|
||||
}
|
||||
}
|
||||
|
||||
int rounded_xMin = roundf (xMin);
|
||||
|
||||
Reference in new issue
Block a user