Skip to content

Commit

Permalink
fix: prevent oor indexing while decoding (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn authored Jul 24, 2024
1 parent 861135e commit daf718d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/model/beatmap/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ impl BeatmapState {
}
}

self.vertices[0].path_type = Some(path_type);
self.vertices
.first_mut()
.ok_or(ParseBeatmapError::InvalidHitObjectLine)?
.path_type = Some(path_type);

let mut start_idx = 0;
let mut end_idx = 0;
Expand Down

0 comments on commit daf718d

Please sign in to comment.