eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
114 stars 130 forks source link

ArrayIndexOutOfBoundsException for large image data #742

Open laeubi opened 1 year ago

laeubi commented 1 year ago

Describe the bug Trying to create a large Image results in

java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
    at org.eclipse.swt.graphics.ImageData.blit(ImageData.java:1971)
    at org.eclipse.swt.graphics.Image.init(Image.java:1294)
    at org.eclipse.swt.graphics.Image.<init>(Image.java:418)

The passed in imagedata for my system where this happens is 40000x2048

It seems it works for roughly 30000x2048 before it fails.

Environment:

  1. Select the platform(s) on which the behavior is seen:

      • [ ] All OS
      • [ ] Windows
      • [x] Linux
      • [ ] macOS
  2. Additional OS info (e.g. OS version, Linux Desktop, etc)

  3. JRE/JDK version

Version since Eclipse or SWT version since when the behavior is seen [e.g. 4.23]

Workaround (or) Additional context Add any other context about the problem here. Any known workarounds for the problem?

deepika-u commented 1 year ago

@laeubi Can you please share a snippet for the reported problem so that we can check on other platforms if the problem persists.