Project: Eclipse_Platform_UI
Bug 175085 SWT errors due to oversized overlay icon
Reported: 2007-02-22 03:07:04 | Status: verified fixed

I just updated to Eclipse 3.3 and received a lot of SWT errors. The trace showed the cause to be imageData.setAlpha(xx,yy,alpha) called within CompositeImageDescriptor. Apparantly one of the projects in my workspace had the honour of receiving a label overlay image with a size of 17x16 pixels. As the label image is 16x16 pixels and the overlay image is drawn TopRight, the CompositeImageDescriptor.drawImage was called with parameter 'ox' being -1. This in turn causes the ImageData.setAlpha() at the end of this method to be called with 'xx' being -1, falling outside of the ImageData boundaries and hence triggering the SWT error. It seems the imageData.setPixel() call just above it is protected in an 'if ( xx >= 0 && xx < imageData.width && yy > 0 ...)' block and a solution might be to move the setAlpha() call also within this block. But this part of Eclipse is totally new for me so correct me if I'm looking at the wrong place, or let me know if you need more info. Regards, Wieant

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/CompositeImageDescriptor.java