From: <ai...@us...> - 2014-04-07 21:43:21
|
Revision: 13099 http://sourceforge.net/p/plplot/code/13099 Author: airwin Date: 2014-04-07 21:43:17 +0000 (Mon, 07 Apr 2014) Log Message: ----------- Fix an integer overflow by only calculating physical coordinates of the origin of the axes when those additional axes are actually used (i.e., when the "a" option is specified and the drawn axis is going to be inside the viewport). This fix solves an integer overflow issue discovered by Hazen for page 5 and larger for example 29 where the 0., 0., world coordinates of the unused axes generated with plbox were so far from the actual X world-coordinate range of the plot that integer overflow occurred when calculating the unused physical coordinates corresponding the the 0.,0., world coordinates of the axes origin. Modified Paths: -------------- trunk/src/plbox.c Modified: trunk/src/plbox.c =================================================================== --- trunk/src/plbox.c 2014-04-06 19:41:22 UTC (rev 13098) +++ trunk/src/plbox.c 2014-04-07 21:43:17 UTC (rev 13099) @@ -176,11 +176,6 @@ plsc->boxbb_ymax = plsc->vppyma / plsc->ypmm; } -// Convert world coordinates to physical - - xp0 = plP_wcpcx( x0 ); - yp0 = plP_wcpcy( y0 ); - // Set plot options from input lax = plP_stsearch( xopt, 'a' ); @@ -495,6 +490,8 @@ // Draw the horizontal axis. if ( lax ) { + // Convert world coordinates to physical + yp0 = plP_wcpcy( y0 ); plP_movphy( vppxmi, (PLINT) yp0 ); plP_draphy( vppxma, (PLINT) yp0 ); if ( ltx && !lxx ) @@ -535,6 +532,8 @@ // Draw the vertical axis. if ( lay ) { + // Convert world coordinates to physical + xp0 = plP_wcpcx( x0 ); plP_movphy( (PLINT) xp0, vppymi ); plP_draphy( (PLINT) xp0, vppyma ); if ( lty && !lxy ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |