Bug 53035 - rendering a GeneralPath with NaN as a point outputs a corrupt SVG path
Summary: rendering a GeneralPath with NaN as a point outputs a corrupt SVG path
Status: NEW
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: SVGGraphics2D (show other bugs)
Version: 1.7
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-04 22:28 UTC by Andy Wilcock
Modified: 2012-04-04 22:33 UTC (History)
0 users



Attachments
Minimal test case for the problem (1.41 KB, application/octet-stream)
2012-04-04 22:33 UTC, Andy Wilcock
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Wilcock 2012-04-04 22:28:27 UTC
Using the SVGGraphics2D with the following code:

   public void paint(Graphics2D g2d) {
		GeneralPath gp = new GeneralPath();
		gp.moveTo(0,0);
		gp.lineTo(100,100);
                // OOPS!!!
		gp.lineTo(Double.NaN,Double.NaN);
		g2d.draw(gp);
   }

The presence of the NaN in the path will cause the SVG output to contain an invalid/corrupt path i.e.:

<path style="fill:none;" d="M0 0 L100 100 L� �"/>

Full test case added as an attachment.


I fully understand that this is not something one would normally do, but the lack of any exception/error was a surprise.
Comment 1 Andy Wilcock 2012-04-04 22:33:01 UTC
Created attachment 28544 [details]
Minimal test case for the problem