From eac42ae50ae2fbc7e83a030728028df87178505f Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sun, 14 Jul 2019 13:33:20 +0200 Subject: [PATCH] [libgdx] Disallow creating a timeline with 0 frames. --- .../spine-libgdx/src/com/esotericsoftware/spine/Animation.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java index 283fd5908..553d1566e 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java @@ -883,6 +883,7 @@ public class Animation { final String[] attachmentNames; public AttachmentTimeline (int frameCount) { + if (frameCount <= 0) throw new IllegalArgumentException("frameCount must be > 0: " + frameCount); frames = new float[frameCount]; attachmentNames = new String[frameCount]; } @@ -1197,6 +1198,7 @@ public class Animation { private final Event[] events; public EventTimeline (int frameCount) { + if (frameCount <= 0) throw new IllegalArgumentException("frameCount must be > 0: " + frameCount); frames = new float[frameCount]; events = new Event[frameCount]; } @@ -1263,6 +1265,7 @@ public class Animation { private final int[][] drawOrders; public DrawOrderTimeline (int frameCount) { + if (frameCount <= 0) throw new IllegalArgumentException("frameCount must be > 0: " + frameCount); frames = new float[frameCount]; drawOrders = new int[frameCount][]; }