Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.

Commit 5f0d996

Browse files
committed
Don't die on bad timingpoints or hitobjects (closes #5)
1 parent 7767526 commit 5f0d996

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

OppaiSharp/OppaiSharp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<PackageLicenseUrl>https://github.com/HoLLy-HaCKeR/OppaiSharp/blob/master/LICENSE</PackageLicenseUrl>
1313
<RepositoryType>Git</RepositoryType>
1414
<PackageTags>osu! osu pp oppai</PackageTags>
15-
<PackageReleaseNotes>Fix wrong AR value being set if AR is not found</PackageReleaseNotes>
16-
<Version>2.0.3</Version>
15+
<PackageReleaseNotes>Don't die on bad timingpoints or hitobjects</PackageReleaseNotes>
16+
<Version>2.0.4</Version>
1717
</PropertyGroup>
1818

1919
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

OppaiSharp/Parser.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ public static Beatmap Read(StreamReader reader)
9696

9797
if (splitted.Length > 8)
9898
Warn("timing point with trailing values");
99+
else if (splitted.Length < 7) {
100+
Warn("timing point with too little values");
101+
continue;
102+
}
103+
99104

100105
var t = new Timing {
101106
Time = double.Parse(splitted[0], CultureInfo.InvariantCulture),
@@ -114,6 +119,10 @@ public static Beatmap Read(StreamReader reader)
114119

115120
if (s.Length > 11)
116121
Warn("object with trailing values");
122+
else if (s.Length < 5) {
123+
Warn("object with too little values");
124+
continue;
125+
}
117126

118127
var obj = new HitObject {
119128
Time = double.Parse(s[2], CultureInfo.InvariantCulture),

0 commit comments

Comments
 (0)