mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-09 17:31:59 +00:00
Fixed #1954 Incorrect calculation of empty button bounds causing OutOfMemory
This commit is contained in:
@@ -207,6 +207,7 @@ public class DefineButton2Tag extends ButtonTag implements ASMSourceContainer {
|
||||
}
|
||||
|
||||
RECT rect = new RECT(Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE);
|
||||
boolean foundSomething = false;
|
||||
for (BUTTONRECORD r : characters) {
|
||||
CharacterTag ch = swf.getCharacter(r.characterId);
|
||||
if (ch instanceof BoundedTag) {
|
||||
@@ -223,9 +224,14 @@ public class DefineButton2Tag extends ButtonTag implements ASMSourceContainer {
|
||||
rect.Ymin = Math.min(r2.Ymin, rect.Ymin);
|
||||
rect.Xmax = Math.max(r2.Xmax, rect.Xmax);
|
||||
rect.Ymax = Math.max(r2.Ymax, rect.Ymax);
|
||||
foundSomething = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundSomething) {
|
||||
rect = new RECT();
|
||||
}
|
||||
|
||||
if (cache != null) {
|
||||
cache.put(this, rect);
|
||||
|
||||
@@ -195,6 +195,7 @@ public class DefineButtonTag extends ButtonTag implements ASMSourceContainer {
|
||||
}
|
||||
|
||||
RECT rect = new RECT(Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE);
|
||||
boolean foundSomething = false;
|
||||
for (BUTTONRECORD r : characters) {
|
||||
CharacterTag ch = swf.getCharacter(r.characterId);
|
||||
if (ch instanceof BoundedTag) {
|
||||
@@ -211,10 +212,15 @@ public class DefineButtonTag extends ButtonTag implements ASMSourceContainer {
|
||||
rect.Ymin = Math.min(r2.Ymin, rect.Ymin);
|
||||
rect.Xmax = Math.max(r2.Xmax, rect.Xmax);
|
||||
rect.Ymax = Math.max(r2.Ymax, rect.Ymax);
|
||||
foundSomething = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundSomething) {
|
||||
rect = new RECT();
|
||||
}
|
||||
|
||||
if (cache != null) {
|
||||
cache.put(this, rect);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user