aboutsummaryrefslogtreecommitdiff
path: root/src/scaling-report.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-07-13 21:06:41 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:33 +0100
commit7d86814aaf05835724154dc64f9907898b419c3a (patch)
tree3be790308165ec7c0b3411691ce1e7bbba93dbfb /src/scaling-report.c
parent7447a444908886a818d1ed80da7ebd52161b375e (diff)
Protect against stupid scale factors
Diffstat (limited to 'src/scaling-report.c')
-rw-r--r--src/scaling-report.c4
1 files changed, 4 insertions, 0 deletions
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 {