summaryrefslogtreecommitdiff
path: root/src/base/ftobjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/ftobjs.c')
-rw-r--r--src/base/ftobjs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 7f1f063cc..8b99a2088 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -3276,6 +3276,14 @@
if ( h < 0 )
h = -h;
+ if ( ( !w && req->width ) ||
+ ( !h && ( req->height || !req->width ) ) )
+ {
+ FT_ERROR(( "FT_Request_Metrics: Divide by zero\n" ));
+ error = FT_ERR( Divide_By_Zero );
+ goto Exit;
+ }
+
scaled_w = FT_REQUEST_WIDTH ( req );
scaled_h = FT_REQUEST_HEIGHT( req );