summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2010-06-05 17:57:51 +0200
committerSebastian Rasmussen <sebras@hotmail.com>2010-06-05 17:57:51 +0200
commitf2b9f911bbf55fdc55ecc1dca9986c041810d93c (patch)
treec58091a720f9cac8d6c4a1a4fcb2f689e528e61f
parentff007e9e3b22219ae2d5ce3518ef8060d28d1371 (diff)
downloadmupdf-f2b9f911bbf55fdc55ecc1dca9986c041810d93c.tar.xz
Fix bug where input values to PostScript functions were not clamped.
-rw-r--r--mupdf/pdf_function.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mupdf/pdf_function.c b/mupdf/pdf_function.c
index d112afae..7d94af8b 100644
--- a/mupdf/pdf_function.c
+++ b/mupdf/pdf_function.c
@@ -1533,7 +1533,11 @@ pdf_evalfunction(pdf_function *func, float *in, int inlen, float *out, int outle
psinitstack(&st);
for (i = 0; i < func->m; ++i)
- SAFE_PUSHREAL(&st, in[i]);
+ {
+ float x;
+ x = CLAMP(in[i], func->domain[i][0], func->domain[i][1]);
+ SAFE_PUSHREAL(&st, x);
+ }
error = evalpostscriptfunc(func, &st, 0);
if (error)