From 5fe5ccc793152747266aea2c43aed8f35228051e Mon Sep 17 00:00:00 2001 From: Christopher Schnick Date: Thu, 22 Jun 2023 18:51:27 +0200 Subject: [PATCH] Fix OOB --- .../java/com/crschnick/pdxu/app/gui/game/Vic2GuiFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdxu-app/src/main/java/com/crschnick/pdxu/app/gui/game/Vic2GuiFactory.java b/pdxu-app/src/main/java/com/crschnick/pdxu/app/gui/game/Vic2GuiFactory.java index 9ce306e1..50bf0af5 100644 --- a/pdxu-app/src/main/java/com/crschnick/pdxu/app/gui/game/Vic2GuiFactory.java +++ b/pdxu-app/src/main/java/com/crschnick/pdxu/app/gui/game/Vic2GuiFactory.java @@ -28,7 +28,7 @@ public Image tagImage(SavegameInfo info, Vic2Tag tag) { public Pane createIcon() { var icon = GameImage.getGameIcon(Game.VIC2); var cut = ImageHelper.cut(icon, - new Rectangle2D(125, 0, icon.getWidth() - 240, icon.getHeight())); + new Rectangle2D(125, 0, Math.max(0, icon.getWidth() - 240), Math.max(0, icon.getHeight()))); return GameImage.imageNode(cut, GuiStyle.CLASS_IMAGE_ICON); }