From 6fc12943e99b05f489b634e79b5cd590eb7ffc3f Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 24 Jun 2010 20:20:26 +0200 Subject: [PATCH] Fix Savannah bug #30247. * src/pcf/pcfread.c (pcf_get_metrics): Disallow (invalid) fonts with zero metrics. --- ChangeLog | 7 +++++++ src/pcf/pcfread.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f5cdb6e1f..5119c6d03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-06-24 Werner Lemberg + + Fix Savannah bug #30247. + + * src/pcf/pcfread.c (pcf_get_metrics): Disallow (invalid) fonts with + zero metrics. + 2010-06-24 Graham Asher * src/smooth/ftgrays.c (gray_render_cubic): Fix algorithm. diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c index 08becf99c..f7326238c 100644 --- a/src/pcf/pcfread.c +++ b/src/pcf/pcfread.c @@ -2,7 +2,8 @@ FreeType font driver for pcf fonts - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy @@ -607,6 +608,9 @@ THE SOFTWARE. face->nmetrics = nmetrics; + if ( !nmetrics ) + return PCF_Err_Invalid_Table; + FT_TRACE4(( "pcf_get_metrics:\n" )); FT_TRACE4(( " number of metrics: %d\n", nmetrics ));