diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-07-04 17:29:04 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-07-05 17:05:16 +0100 |
commit | fdda884c097d52e687ddbbe1fdafb375caf45165 (patch) | |
tree | 5682a7987deae08b97f8a0741bcbced8677116aa | |
parent | ee382eb9e03bd609bc0da95a77e7b7232d7e56d5 (diff) | |
download | mupdf-fdda884c097d52e687ddbbe1fdafb375caf45165.tar.xz |
Cope with illegal alpha values (out of range)
normal_457.pdf specifies an alpha value of 1.005, which causes overflows
when calculating values. Simply clamp values into the 0..1 range.
-rw-r--r-- | pdf/pdf_interpret.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c index c01e0e32..ab55ee66 100644 --- a/pdf/pdf_interpret.c +++ b/pdf/pdf_interpret.c @@ -1521,10 +1521,10 @@ pdf_run_extgstate(pdf_csi *csi, pdf_obj *rdb, pdf_obj *extgstate) } else if (!strcmp(s, "CA")) - gstate->stroke.alpha = pdf_to_real(val); + gstate->stroke.alpha = fz_clamp(pdf_to_real(val), 0, 1); else if (!strcmp(s, "ca")) - gstate->fill.alpha = pdf_to_real(val); + gstate->fill.alpha = fz_clamp(pdf_to_real(val), 0, 1); else if (!strcmp(s, "BM")) { |