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

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.16.4, 20w51a, 1.16.5
    • Fix Version/s: 21w18a
    • Labels:
    • Environment:
      Operating System: Windows 10 x64
      Java Version: 11.0.9.1, AdoptOpenJDK
    • Confirmation Status:
      Confirmed
    • Category:
      Crash
    • Mojang Priority:
      Very Important

      Description

      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)
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              CHK: