From d03261cb90a6ba9e9a102e2393d4456760ece638 Mon Sep 17 00:00:00 2001 From: LAX1DUDE Date: Thu, 20 Oct 2022 21:09:10 -0700 Subject: [PATCH] fixed bitwise overflow glitch in PNG alpha channel --- .../net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java index 54adcfd..1ad66f6 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java @@ -1084,7 +1084,7 @@ public class EaglerAdapterImpl2 { int[] pixels = new int[totalPixels]; for(int i = 0, j; i < pixels.length; ++i) { j = dv.getUint32(i << 2, false); - pixels[i] = (j >> 8) | ((j & 0xFF) << 24); + pixels[i] = ((j >> 8) & 0xFFFFFF) | ((j & 0xFF) << 24); } ret.complete(new EaglerImage(pixels, pxlsDat.getWidth(), pxlsDat.getHeight(), true)); }