--- a/net/minecraft/nbt/IntArrayTag.java
+++ b/net/minecraft/nbt/IntArrayTag.java
@@ -23,6 +_,7 @@
         private static int[] readAccounted(DataInput input, NbtAccounter accounter) throws IOException {
             accounter.accountBytes(24L);
             int _int = input.readInt();
+            com.google.common.base.Preconditions.checkArgument(_int < 1 << 24); // Spigot
             accounter.accountBytes(4L, _int);
             int[] ints = new int[_int];
 
