diff options
author | Thomas White <taw@bitwiz.org.uk> | 2011-07-13 21:06:41 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:33 +0100 |
commit | 7d86814aaf05835724154dc64f9907898b419c3a (patch) | |
tree | 3be790308165ec7c0b3411691ce1e7bbba93dbfb /src/scaling-report.c | |
parent | 7447a444908886a818d1ed80da7ebd52161b375e (diff) |
Protect against stupid scale factors
Diffstat (limited to 'src/scaling-report.c')
-rw-r--r-- | src/scaling-report.c | 4 |
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 { |