From 28018d42a83f8c8547fb5d3d5e697f187e23eb44 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Tue, 12 Aug 2014 00:26:16 -0400 Subject: [PATCH] [base] Handle collapsed outlines to avoid undefined FT_MSB. * src/base/ftoutln.c (FT_Outline_Get_Orientation): Update. --- ChangeLog | 6 ++++++ src/base/ftoutln.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index fc0bd5a22..48e311517 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-08-11 Alexei Podtelezhnikov + + [base] Handle collapsed outlines to avoid undefined FT_MSB. + + * src/base/ftoutln.c (FT_Outline_Get_Orientation): Update. + 2014-08-11 Alexei Podtelezhnikov [base] Restore FT_MulFix inlining. diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c index 4a39dcd7c..632b6d237 100644 --- a/src/base/ftoutln.c +++ b/src/base/ftoutln.c @@ -1045,6 +1045,10 @@ FT_Outline_Get_CBox( outline, &cbox ); + /* Handle collapsed outlines to avoid undefined FT_MSB. */ + if ( cbox.xMin == cbox.xMax || cbox.yMin == cbox.yMax ) + return FT_ORIENTATION_NONE; + xshift = FT_MSB( FT_ABS( cbox.xMax ) | FT_ABS( cbox.xMin ) ) - 14; xshift = FT_MAX( xshift, 0 );