{"record":{"id":"a8dedc7d575eea20","repo":"ppy/osu","slug":"repeat-count-is-way-too-high","errorCode":null,"errorMessage":"Repeat count is way too high","messagePattern":"Repeat count is way too high","errorType":"exception","errorClass":"FormatException","httpStatus":null,"severity":"error","filePath":"osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs","lineNumber":90,"sourceCode":"            var bankInfo = new SampleBankInfo();\r\n\r\n            ConvertHitObject? result = null;\r\n\r\n            if (type.HasFlag(LegacyHitObjectType.Circle))\r\n            {\r\n                result = createHitCircle(pos, combo, comboOffset);\r\n\r\n                if (split.Length > 5)\r\n                    readCustomSampleBanks(split[5], bankInfo);\r\n            }\r\n            else if (type.HasFlag(LegacyHitObjectType.Slider))\r\n            {\r\n                double? length = null;\r\n\r\n                int repeatCount = Parsing.ParseInt(split[6]);\r\n\r\n                if (repeatCount > 9000)\r\n                    throw new FormatException(@\"Repeat count is way too high\");\r\n\r\n                // osu-stable treated the first span of the slider as a repeat, but no repeats are happening\r\n                repeatCount = Math.Max(0, repeatCount - 1);\r\n\r\n                if (split.Length > 7)\r\n                {\r\n                    length = Math.Max(0, Parsing.ParseDouble(split[7], Parsing.MAX_COORDINATE_VALUE));\r\n                    if (length == 0)\r\n                        length = null;\r\n                }\r\n\r\n                if (split.Length > 10)\r\n                    readCustomSampleBanks(split[10], bankInfo, true);\r\n\r\n                // One node for each repeat + the start and end nodes\r\n                int nodes = repeatCount + 2;\r\n\r\n                // Populate node sample bank infos with the default hit object sample bank\r","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs#L72-L108","documentation":"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.","triggerScenarios":"Parsing a .osu beatmap line whose slider repeat count (split[6]) parses to an integer greater than 9000.","commonSituations":"Corrupt, hand-edited, or deliberately malformed beatmap; data corruption in the repeat field.","solutions":["Obtain a corrected/non-corrupt version of the beatmap.","If authoring, lower the repeat count to a sane value.","At import time, catch FormatException and quarantine the offending beatmap rather than failing the whole import."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// at import time, validate the slider line before parsing:\nint repeat = Parsing.ParseInt(split[6]);\nif (repeat > 9000) { /* quarantine beatmap */ }","typeGuard":"bool IsValidRepeatCount(int count) => count <= 9000;","tryCatchPattern":"try { parser.ParseLine(line); }\ncatch (FormatException) { /* malformed beatmap: skip or quarantine */ }","preventionTips":["Validate beatmap fields before committing to parsing.","Reject absurd values at import and report the beatmap as corrupt.","Do not hand-edit .osu repeat fields to extreme values."],"tags":["beatmap","parser","slider","validation","format-exception"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}