ppy/osu · error · FormatException

Repeat count is way too high

Error message

Repeat count is way too high

What it means

Thrown as FormatException by ConvertHitObjectParser when a slider's repeat count field exceeds 9000. This guards against absurd/malicious beatmap data that would create enormous slider vertex counts.

Source

Thrown at osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs:90

            var bankInfo = new SampleBankInfo();

            ConvertHitObject? result = null;

            if (type.HasFlag(LegacyHitObjectType.Circle))
            {
                result = createHitCircle(pos, combo, comboOffset);

                if (split.Length > 5)
                    readCustomSampleBanks(split[5], bankInfo);
            }
            else if (type.HasFlag(LegacyHitObjectType.Slider))
            {
                double? length = null;

                int repeatCount = Parsing.ParseInt(split[6]);

                if (repeatCount > 9000)
                    throw new FormatException(@"Repeat count is way too high");

                // osu-stable treated the first span of the slider as a repeat, but no repeats are happening
                repeatCount = Math.Max(0, repeatCount - 1);

                if (split.Length > 7)
                {
                    length = Math.Max(0, Parsing.ParseDouble(split[7], Parsing.MAX_COORDINATE_VALUE));
                    if (length == 0)
                        length = null;
                }

                if (split.Length > 10)
                    readCustomSampleBanks(split[10], bankInfo, true);

                // One node for each repeat + the start and end nodes
                int nodes = repeatCount + 2;

                // Populate node sample bank infos with the default hit object sample bank

View on GitHub (pinned to d9c73e12ad)

Solutions

  1. Obtain a corrected/non-corrupt version of the beatmap.
  2. If authoring, lower the repeat count to a sane value.
  3. At import time, catch FormatException and quarantine the offending beatmap rather than failing the whole import.
Defensive patterns

Strategy: validation

Validate before calling

// at import time, validate the slider line before parsing:
int repeat = Parsing.ParseInt(split[6]);
if (repeat > 9000) { /* quarantine beatmap */ }

Type guard

bool IsValidRepeatCount(int count) => count <= 9000;

Try / catch

try { parser.ParseLine(line); }
catch (FormatException) { /* malformed beatmap: skip or quarantine */ }

Prevention

When it happens

Trigger: Parsing a .osu beatmap line whose slider repeat count (split[6]) parses to an integer greater than 9000.

Common situations: Corrupt, hand-edited, or deliberately malformed beatmap; data corruption in the repeat field.

Related errors


AI-assisted analysis of ppy/osu@d9c73e12ad (2026-08-13). Data as JSON: /api/errors/a8dedc7d575eea20. Report an issue: GitHub.