diff options
author | Karl Berry <karl@freefriends.org> | 2011-02-25 17:27:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-02-25 17:27:46 +0000 |
commit | b29fdf77e54a9344ce0284a053ee4cd98727dd8a (patch) | |
tree | d07f60aec0beac73bf7436127ed3a1911a468821 /Build/source/texk/dvipsk/drawPS.c | |
parent | 4a48c7546542514ae9137d0418dacf821efe4192 (diff) |
avoid nan result with eepic lines
git-svn-id: svn://tug.org/texlive/trunk@21520 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipsk/drawPS.c')
-rw-r--r-- | Build/source/texk/dvipsk/drawPS.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Build/source/texk/dvipsk/drawPS.c b/Build/source/texk/dvipsk/drawPS.c index 2151b2a2721..4044f113a71 100644 --- a/Build/source/texk/dvipsk/drawPS.c +++ b/Build/source/texk/dvipsk/drawPS.c @@ -287,7 +287,9 @@ flushDashedPath(int dotted, double inchesPerDash) for (i=2; i <= pathLen; i++) { integer dx = hconvPS(xx[i-1]) - hconvPS(xx[i]); integer dy = vconvPS(yy[i-1]) - vconvPS(yy[i]); - double delta = sqrt((double) (dx * dx + dy * dy)); + /* Cast to double before multiplying; otherwise, can result in + integer overflow and thus a negative result (eepic-nan.test). */ + double delta = sqrt((double) (dx) * dx + (double) dy * dy); double ipd; int ndashes; |