summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2012-11-15 20:50:59 -0500
committerAlexei Podtelezhnikov <apodtele@gmail.com>2012-11-15 20:50:59 -0500
commit0690d3d7b59ccb54a9938ff99c8621350780fc6e (patch)
tree186e87bb72dc1390243476976cb86a2649ac9e96
parent3a55340029783ec9ab738698e3e3ab2cd74c882e (diff)
downloadfreetype2-0690d3d7b59ccb54a9938ff99c8621350780fc6e.tar.gz
[base] Fix integer overflows in dd5718c7d67a.
* src/base/ftoutln.c (FT_Outline_EmboldenXY): Use FT_MulDiv.
-rw-r--r--ChangeLog6
-rw-r--r--src/base/ftoutln.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c95739872..f6b3d5207 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-15 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [base] Fix integer overflows in dd5718c7d67a.
+
+ * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use FT_MulDiv.
+
2012-11-15 Werner Lemberg <wl@gnu.org>
[autofit] Trace stem widths.
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 120875276..c4fd2660a 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -968,13 +968,13 @@
if ( orientation == FT_ORIENTATION_TRUETYPE )
q = -q;
- if ( xstrength * q < d * l )
+ if ( FT_MulDiv( xstrength, q, l ) < d )
shift.x = FT_MulDiv( shift.x, xstrength, d );
else
shift.x = FT_MulDiv( shift.x, l, q );
- if ( ystrength * q < d * l )
+ if ( FT_MulDiv( ystrength, q, l ) < d )
shift.y = FT_MulDiv( shift.y, ystrength, d );
else
shift.y = FT_MulDiv( shift.y, l, q );