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

Corrupted .ogg files are not rejected by the sound engine, taking up space in the sound pool until resource reload

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.3, 23w04a, 23w05a, 23w06a, 23w07a, 1.19.4 Pre-release 1, 1.19.4 Pre-release 2, 1.19.4 Pre-release 3, 1.19.4 Pre-release 4, 1.19.4 Release Candidate 2, 1.19.4, 23w12a, 23w13a, 23w14a, 23w17a, 1.20, 1.20.4
    • None
    • Confirmed
    • Resource Packs
    • Low
    • Platform

      The Issue

      When playing a sound from a corrupted .ogg file (which would not be playable in any other application), Minecraft does not log any errors or warnings about the sound file being corrupted. Instead, the sound sits dormant on the sound pool. When enough of these sounds play, the maximum pool size of 247 may be reached and maintained, preventing any further sound events from playing until a client-side resource reload (F3+T or changing resource packs). This even precludes the use of /stopsound.

      Steps to Reproduce

      • Select attached resource pack (corruptsound.zip) from resource pack menu
      • Open Minecraft world and run the command /playsound silent master @s ~ ~ ~ in chat
      • Observe "Sounds: 1/247" in F3 debug screen (once other sound events end, the 1/247 will always persist)
      • Continue running command (at this point, feel free to use a ticking function or repeating command block) until F3 debug screen reads "Sounds: 247/247"
      • Observe that no more sounds are able to play until the user performs a resource reload (F3+T or changing resource packs)
      • Further observe that these sounds cannot be stopped via /stopsound @s master silent or /stopsound @s

      Notes

      I came across this issue while trying to replace some vanilla sounds (minecart riding, opening locked containers, etc.) with a sound file containing one sample of silence for a resource-pack-based minigame. The intention was to hide log warns about missing sounds for events while still preventing them from being audible or registering subtitles for the purposes of the minigame.

      However, the .ogg file I used for this somehow became corrupted from what it was at first (the circumstances of which still confuse me). Once users started playing the game with this file included, they noticed sounds randomly cutting out after a while, which was only fixable via F3+T or changing resource packs.

      Further analysis determined that the silent.ogg file I had used was the culprit. This file, as well as its uncorrupted version (silent_uncorrupted.ogg), has been attached to this bug report and is also included in the attached corruptsound.zip resource pack used to reproduce the bug.

      The intention of this bug report is to prevent future confusion should others happen to accidentally use corrupted sound files for similar purposes. Minecraft should not silently accept and attempt to play from these files or allow them to clutter up the sound pool.

        1. corruptsound.zip
          4 kB
        2. silent_uncorrupted.ogg
          4 kB
        3. silent.ogg
          7 kB

            Unassigned Unassigned
            Evtema3 Evtema3
            Votes:
            8 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: