Summary: | Crash when trying to display a non-existent ImageIcon file | ||
---|---|---|---|
Product: | classpath | Reporter: | Yvan Norsa <yvan.norsa> |
Component: | swing | Assignee: | Roman Kennke <roman> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bug-classpath |
Priority: | P3 | ||
Version: | unspecified | ||
Target Milestone: | 0.91 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Attachments: |
TestCase demonstrating the JVM crash
Small patch fixing the problem |
Description
Yvan Norsa
2006-05-06 10:20:52 UTC
Created attachment 11387 [details]
TestCase demonstrating the JVM crash
Created attachment 11388 [details]
Small patch fixing the problem
I traced the code, and the problem comes from trying to draw the "error image" (that is, a blank GtkImage) (so the bug is probably platform-dependent).
I noticed that when not passing width and height to drawImage(), the bug doesn't occur. That is because in drawPixelsScaled, the width and height parameters are checked, and if they are <= 0, the function returns.
So my fix is to check also the image size, and to return if it is lower or equal than 0.
Fixed. |