Skip to content

Commit

Permalink
[librii] kmp: Additional objflow validation
Browse files Browse the repository at this point in the history
  • Loading branch information
riidefi committed Dec 29, 2024
1 parent c998d6f commit f993085
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/librii/kmp/CourseMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ Result<std::string> IdToStr(int id) {
}
Result<int> StrToId(std::string_view name) {
for (int i = 0; i < Flow.remap_table.size(); ++i) {
if (Flow.parameters[Flow.remap_table[i]].Name == name) {
const int indirect = Flow.remap_table[i];

if (indirect < 0 || indirect >= Flow.parameters.size()) {
continue;
}

if (Flow.parameters[indirect].Name == name) {
return i;
}
}
Expand Down

0 comments on commit f993085

Please sign in to comment.