Add out-of-bounds check to get_sdf_name()

This commit is contained in:
2025-03-05 13:10:54 -06:00
committed by Celtic Minstrel
parent a6d5e29444
commit f091d464d4

View File

@@ -607,6 +607,9 @@ std::string cScenario::get_feature_flag(std::string flag) {
}
std::string cScenario::get_sdf_name(int row, int col) {
if(row < 0 || row >= SDF_ROWS || col < 0 || col >= SDF_COLUMNS){
throw "Tried to access SDF name for out-of-bounds flag (" + std::to_string(row) + ", " + std::to_string(col) + ")";
}
if(sdf_names.find(row) == sdf_names.end())
return "";
if(sdf_names[row].find(col) == sdf_names[row].end())