Skip to content

Commit

Permalink
Merge pull request #6114 from Snuffleupagus/issue-6113
Browse files Browse the repository at this point in the history
Ensure that the result of |constructStichedFromIRResult| is a number (issue 6113)
  • Loading branch information
timvandermeij committed Jun 15, 2015
2 parents c8fd9c8 + 60fbb5e commit d7e6490
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,10 @@ var PDFFunction = (function PDFFunctionClosure() {
var rmin = encode[2 * i];
var rmax = encode[2 * i + 1];

tmpBuf[0] = rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin);
// Prevent the value from becoming NaN as a result
// of division by zero (fixes issue6113.pdf).
tmpBuf[0] = dmin === dmax ? rmin :
rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin);

// call the appropriate function
fns[i](tmpBuf, 0, dest, destOffset);
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/issue6113.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://web.archive.org/web/20150319000257/http://www.niseko.ne.jp/en/map/pdf/FPmap_en.pdf?1413937768
9 changes: 9 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,15 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue6113",
"file": "pdfs/issue6113.pdf",
"md5": "7919dbdcd1da04914d7e8dfb05aeb86a",
"rounds": 1,
"link": true,
"firstPage": 1,
"lastPage": 1,
"type": "eq"
},
{ "id": "blendmode",
"file": "pdfs/blendmode.pdf",
"md5": "5a86e7e9333e93c58abc3f382e1e6ea2",
Expand Down

0 comments on commit d7e6490

Please sign in to comment.