Loading in a TrueTypeFont with an out-of-bounds size crashes the game
The bug
Loading in a TrueType font with a size set to an out-of-bounds value (such as -1) in the font JSON causes the game to crash with an IllegalStateException whilst trying to render it. The game will also crash on startup if the resource pack with the font is not removed/disabled.
How to reproduce
- Download the attached resource pack and move it to your resource packs folder
- Attempt to enable the resource pack
Stack trace
Description: Rendering overlay java.lang.IllegalStateException: Image is not allocated. at djw.h(SourceFile:155) at djw.b(SourceFile:365) at djw.a(SourceFile:359) at djw.a(SourceFile:348) at djg$a.a(SourceFile:154) at dsc.a(SourceFile:52) at dsb.a(SourceFile:131) at dsb.d(SourceFile:117) at it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap.computeIfAbsent(Int2ObjectOpenHashMap.java:479) at dsb.b(SourceFile:117) at dpz$a.accept(SourceFile:220) at age.a(SourceFile:17) at age.a(SourceFile:43) at afp.b(SourceFile:23) at dpz.c(SourceFile:312) at dpz.b(SourceFile:167) at dpz.a(SourceFile:133) at dpz.a(SourceFile:115) at dpz.a(SourceFile:73) at dqb.a(SourceFile:124) at dtp.a(SourceFile:132) at dtm.a(SourceFile:75) at egc.a(SourceFile:612) at dpe.e(SourceFile:1053) at dpe.e(SourceFile:688) at net.minecraft.client.main.Main.main(SourceFile:215)
Environment
Operating System: Windows 10 x64
Java Version: 11.0.9.1, AdoptOpenJDK
Created Issue:
Loading in a TrueTypeFont with an out-of-bounds size crashes the game
Loading in a TrueType font with a size set to an out-of-bounds value (such as -1) in the font JSON causes the game to crash with an IllegalStateException whilst trying to render it. The game will also crash on startup if the resource pack with the font is not removed/disabled.
Here's the easiest way to recreate it:
1. Download the attached resource pack and move it to your resource packs folder.
2. Attempt to enable the resource pack.Environment
Operating System: Windows 10 x64
Java Version: 11.0.9.1, AdoptOpenJDK
Loading in a TrueType font with a size set to an out-of-bounds value (such as -1) in the font JSON causes the game to crash with an IllegalStateException whilst trying to render it. The game will also crash on startup if the resource pack with the font is not removed/disabled.
Here's the easiest way to recreate it:
1. Download the attached resource pack and move it to your resource packs folder.
2. Attempt to enable the resource pack.The bug
Loading in a TrueType font with a size set to an out-of-bounds value (such as -1) in the font JSON causes the game to crash with an IllegalStateException whilst trying to render it. The game will also crash on startup if the resource pack with the font is not removed/disabled.
How to reproduce
- Download the attached resource pack and move it to your resource packs folder
- Attempt to enable the resource pack.
The bug
Loading in a TrueType font with a size set to an out-of-bounds value (such as -1) in the font JSON causes the game to crash with an IllegalStateException whilst trying to render it. The game will also crash on startup if the resource pack with the font is not removed/disabled.
How to reproduce
- Download the attached resource pack and move it to your resource packs folder
- Attempt to enable the resource pack
.The bug
Loading in a TrueType font with a size set to an out-of-bounds value (such as -1) in the font JSON causes the game to crash with an IllegalStateException whilst trying to render it. The game will also crash on startup if the resource pack with the font is not removed/disabled.
How to reproduce
- Download the attached resource pack and move it to your resource packs folder
- Attempt to enable the resource pack
tack trace
Description: Rendering overlay java.lang.IllegalStateException: Image is not allocated. at djw.h(SourceFile:155) at djw.b(SourceFile:365) at djw.a(SourceFile:359) at djw.a(SourceFile:348) at djg$a.a(SourceFile:154) at dsc.a(SourceFile:52) at dsb.a(SourceFile:131) at dsb.d(SourceFile:117) at it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap.computeIfAbsent(Int2ObjectOpenHashMap.java:479) at dsb.b(SourceFile:117) at dpz$a.accept(SourceFile:220) at age.a(SourceFile:17) at age.a(SourceFile:43) at afp.b(SourceFile:23) at dpz.c(SourceFile:312) at dpz.b(SourceFile:167) at dpz.a(SourceFile:133) at dpz.a(SourceFile:115) at dpz.a(SourceFile:73) at dqb.a(SourceFile:124) at dtp.a(SourceFile:132) at dtm.a(SourceFile:75) at egc.a(SourceFile:612) at dpe.e(SourceFile:1053) at dpe.e(SourceFile:688) at net.minecraft.client.main.Main.main(SourceFile:215)
The bug
Loading in a TrueType font with a size set to an out-of-bounds value (such as -1) in the font JSON causes the game to crash with an IllegalStateException whilst trying to render it. The game will also crash on startup if the resource pack with the font is not removed/disabled.
How to reproduce
- Download the attached resource pack and move it to your resource packs folder
- Attempt to enable the resource pack
Stack trace
Description: Rendering overlay java.lang.IllegalStateException: Image is not allocated. at djw.h(SourceFile:155) at djw.b(SourceFile:365) at djw.a(SourceFile:359) at djw.a(SourceFile:348) at djg$a.a(SourceFile:154) at dsc.a(SourceFile:52) at dsb.a(SourceFile:131) at dsb.d(SourceFile:117) at it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap.computeIfAbsent(Int2ObjectOpenHashMap.java:479) at dsb.b(SourceFile:117) at dpz$a.accept(SourceFile:220) at age.a(SourceFile:17) at age.a(SourceFile:43) at afp.b(SourceFile:23) at dpz.c(SourceFile:312) at dpz.b(SourceFile:167) at dpz.a(SourceFile:133) at dpz.a(SourceFile:115) at dpz.a(SourceFile:73) at dqb.a(SourceFile:124) at dtp.a(SourceFile:132) at dtm.a(SourceFile:75) at egc.a(SourceFile:612) at dpe.e(SourceFile:1053) at dpe.e(SourceFile:688) at net.minecraft.client.main.Main.main(SourceFile:215)

Just confirmed this also affects 1.16.5.