1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Ensure that the result of |constructStichedFromIRResult| is a number (issue 6113)

Fixes 6113.
This commit is contained in:
Jonas Jenwald 2015-06-14 13:44:43 +02:00
parent c8fd9c8c06
commit 60fbb5ef69
3 changed files with 14 additions and 1 deletions

View file

@ -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);