Bug 175085 - SWT errors due to oversized overlay icon
Summary: SWT errors due to oversized overlay icon
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-02-22 03:07 EST by Wieant CLA
Modified: 2007-05-01 08:03 EDT (History)
0 users

See Also:


Attachments
Patch proposal (870 bytes, patch)
2007-02-22 03:08 EST, Wieant CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wieant CLA 2007-02-22 03:07:04 EST
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
Comment 1 Wieant CLA 2007-02-22 03:08:17 EST
Created attachment 59544 [details]
Patch proposal
Comment 2 Tod Creasey CLA 2007-03-29 14:53:19 EDT
Your analysis is correct - thanks for the patch.

Released for build >20070329
Comment 3 Tod Creasey CLA 2007-04-30 11:35:46 EDT
Wieant could you verify this in build >=I20070430-0010
Comment 4 Wieant CLA 2007-05-01 05:09:41 EDT
No problem, verified in build =I20070501-0010.
Comment 5 Tod Creasey CLA 2007-05-01 08:03:26 EDT
Thanks Wieant