Bug 175085 SWT errors due to oversized overlay icon
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
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/CompositeImageDescriptor.java
/**
	 * The image data for this composite image.
	 */
	private ImageData imageData;
	/**
	 * Constructs an uninitialized composite image.
	 */
	protected CompositeImageDescriptor() {
	}
	/**
	 * Returns the index of a RGB entry in the given map which matches the
	 * specified RGB color. If no such entry exists, a new RGB is allocated. If
	 * the given array is full, the value 0 is returned (which maps to the
	 * transparency value).
	 */
	private static int alloc(RGB[] map, int red, int green, int blue) {
		int i;
		RGB c;