Mojira Archive
MC-248792

Placing a Painting/Item Frame with invalid tile coordinates crashes the game

The bug

Coordinates provided in a painting/item frame's NBT are not validated by the game when attempting to place one with values for the TileX, TileY, and TileZ entity values. When you attempt to place one with out-of-bounds values, the game tries to generate the chunk multiple times (with each attempt failing with an ArrayIndexOutOfBoundsException), before eventually giving up and crashing.

Method to reproduce

  1. Give yourself the painting with this command:
    /give @p minecraft:painting{EntityTag:{TileX:-2147483648,TileY:100,TileZ:-2147483648}}
    
  2. Try to place it.

Stack trace

Description: Exception generating new chunk

java.lang.ArrayIndexOutOfBoundsException: Index 1073742112 out of bounds for length 315
    at csq$c.a(SourceFile:238)
    at cti.a(SourceFile:451)
    at ctg.a(SourceFile:181)
    at ddg.apply(SourceFile:20)
    at ctf.a(SourceFile:235)
    at ctf.a(SourceFile:188)
    at deq.a(SourceFile:40)
    at cyi.a(SourceFile:256)
    at cvw.a(SourceFile:36)
    at cpz.a(SourceFile:427)
    at cqb.f(SourceFile:59)
    at cqb.a(SourceFile:289)
    at acv.a(SourceFile:605)
    at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
    at acv.a(SourceFile:599)
    at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
    at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
    at acx.b(SourceFile:58)
    at auk.g(SourceFile:91)
    at auk.a(SourceFile:146)
    at auk.run(SourceFile:102)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) 

Fixed

_Video

[Mojang] slicedlime

2022-02-24, 11:57 AM

2022-06-01, 09:16 AM

2022-06-01, 09:16 AM

1

2

Confirmed

Very Important

Crash

Out-of-bounds, crash, painting

1.18.1, 1.18.2 Pre-release 3, 1.18.2, 1.19 Pre-release 2

1.19 Pre-release 5