Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-211064

Loading in a TrueTypeFont with an out-of-bounds size crashes the game

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 21w18a
    • 1.16.4, 20w51a, 1.16.5
    • Operating System: Windows 10 x64
      Java Version: 11.0.9.1, AdoptOpenJDK
    • Confirmed
    • Crash
    • Very Important

      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

      1. Download the attached resource pack and move it to your resource packs folder
      2. 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)
      

        1. crash-2021-01-10_07.15.43-client.txt
          4 kB
          _Video
        2. crash-2021-01-11_12.35.26-client.txt
          3 kB
          [Mod] Michael Wobst
        3. image-2021-01-10-07-17-01-529.png
          4 kB
          _Video

            xilefian [Mojang] Felix Jones
            VideoGameSmash12 _Video
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: