From 7d86814aaf05835724154dc64f9907898b419c3a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 13 Jul 2011 21:06:41 +0200 Subject: Protect against stupid scale factors --- src/scaling-report.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/scaling-report.c') diff --git a/src/scaling-report.c b/src/scaling-report.c index 197f72f9..2cfafd09 100644 --- a/src/scaling-report.c +++ b/src/scaling-report.c @@ -389,6 +389,10 @@ static void scale_factor_histogram(cairo_t *cr, const struct image *images, if ( osf > osf_max ) osf_max = osf; } osf_max = ceil(osf_max); + if ( osf_max > 1000.0 ) { + ERROR("Silly scale factor detected. Using 100.0 instead.\n"); + osf_max = 100.0; + } do { -- cgit v1.2.3