1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 21:13:01 +08:00

Limit beatmap encoder & decoder to at most 8 combo colours

This commit is contained in:
Bartłomiej Dach
2025-02-26 11:13:57 +01:00
Unverified
parent e48d36ad1e
commit 2167c7b8d5
2 changed files with 6 additions and 2 deletions
@@ -349,7 +349,7 @@ namespace osu.Game.Beatmaps.Formats
writer.WriteLine("[Colours]");
for (int i = 0; i < colours.Count; i++)
for (int i = 0; i < Math.Min(colours.Count, LegacyBeatmapDecoder.MAX_COMBO_COLOUR_COUNT); i++)
{
var comboColour = colours[i];
+5 -1
View File
@@ -18,6 +18,8 @@ namespace osu.Game.Beatmaps.Formats
{
public const int LATEST_VERSION = 14;
public const int MAX_COMBO_COLOUR_COUNT = 8;
/// <summary>
/// The .osu format (beatmap) version.
///
@@ -126,7 +128,9 @@ namespace osu.Game.Beatmaps.Formats
string[] split = pair.Value.Split(',');
Color4 colour = convertSettingStringToColor4(split, allowAlpha, pair);
bool isCombo = pair.Key.StartsWith(@"Combo", StringComparison.Ordinal);
bool isCombo = pair.Key.StartsWith(@"Combo", StringComparison.Ordinal)
&& int.TryParse(pair.Key[5..], out int comboIndex)
&& comboIndex >= 1 && comboIndex <= MAX_COMBO_COLOUR_COUNT;
if (isCombo)
{