Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating XYLineAnnotation with NaN Values causes ChartUtils.writeChartAsPNG() to hang #223

Closed
davewichers opened this issue May 11, 2021 · 2 comments

Comments

@davewichers
Copy link

I have code that is accidentally passing NaN values to the 1st, 3rd, and 4th double values for the 6 parameter constructor of XYLineAnnotation(). See: https://github.com/jfree/jfreechart/blob/master/src/main/java/org/jfree/chart/annotations/XYLineAnnotation.java#L118

This annotation is then added to a chart, and later on, when I invoke ChartUtils.writeChartAsPNG() with this chart, that method simply hangs. Seems like the XYLineAnnotation() constructors should all verify that all the doubles passed to them are actual numbers. Regardless, the ChartUtils.writeChartAsPNG() method shouldn't simply hang.

@jfree
Copy link
Owner

jfree commented May 15, 2021

Thanks for the report. I added some argument validations to prevent this happening.

@jfree
Copy link
Owner

jfree commented May 15, 2021

5ca5d26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants