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

Extreme values for nine_slice border will bleed gui.png-atlas

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.4, 24w10a, 1.21
    • None
    • Community Consensus
    • Resource Packs, UI

      Discovered while testing MC-269152. Relates to MC-264260, MC-267877, MC-236285 and MC-246230.

      The bug

      By specifying absurd values in the mcmeta file for a chosen UI texture, we can bleed the texture atlas and display parts of it that should not be visible in this context.

      Specifically, at least for the case where only one value is to be specified instead of four, setting "border" to a value between 1073741824 and 2147483647 will cause twice that number to roll over and become negative.

      How to reproduce

      1. Download and apply the attached resource pack
      2. Observe

      Expected results

      Due to the invalid nature of the mcmeta file, I'd expect missing textures.

      Actual results

      A mishmash of texture atlas parts.

      How to fix

      Assuming converting everything over to unsigned integers or unsigned longs isn't an option, the fix should be simple: before we verify that the value for (border + border) is less than the width and height, we should check if (border + border) is positive. If not, throw an error and use the missing texture.

            Unassigned Unassigned
            Awesoman3000 Connor Steppie
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: