We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4a4d28 commit 5db1843Copy full SHA for 5db1843
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/ImageLoader.java
@@ -180,10 +180,7 @@ boolean isInterlacedPNG(byte [] imageAsByteArray) {
180
List<ImageData> imgDataList = new ArrayList<>();
181
try {
182
// 1) Load InputStream into byte array
183
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
184
- stream.transferTo(baos);
185
- baos.flush();
186
- byte[] data_buffer = baos.toByteArray();
+ byte[] data_buffer = stream.readAllBytes();
187
if (data_buffer.length == 0) SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT); // empty stream
188
189
// 2) Copy byte array to C memory, write to GdkPixbufLoader
0 commit comments