summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-03-22 21:42:44 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-03-23 15:58:47 +0100
commitf457923b92ad0a6d9fe736bf8021c652bc654d72 (patch)
tree53cffe919a7fa6c52a3b0dfce283c564e01e4cc5 /source/fitz
parent005ab6e5a14f8b6df450a5374315f1e017e4f1ed (diff)
downloadmupdf-f457923b92ad0a6d9fe736bf8021c652bc654d72.tar.xz
Clamp too large image resolution values.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/fitz/image.c b/source/fitz/image.c
index 81bb5575..bb0a6057 100644
--- a/source/fitz/image.c
+++ b/source/fitz/image.c
@@ -1,6 +1,7 @@
#include "mupdf/fitz.h"
#define SANE_DPI 72.0f
+#define INSANE_DPI 4800.0f
fz_image *
fz_keep_image(fz_context *ctx, fz_image *image)
@@ -582,7 +583,7 @@ fz_image_resolution(fz_image *image, int *xres, int *yres)
}
/* Scale xres and yres up until we get beleivable values */
- if (*xres < SANE_DPI || *yres < SANE_DPI)
+ if (*xres < SANE_DPI || *yres < SANE_DPI || *xres > INSANE_DPI || *yres > INSANE_DPI)
{
if (*xres == *yres)
{