Add out-of-bounds check to get_sdf_name()
This commit is contained in:
@@ -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())
|
||||
|
Reference in New Issue
Block a user