mirror of
https://github.com/okalachev/flix.git
synced 2026-01-10 21:16:50 +00:00
Check if requested parameters indexes are correct
In case if gcs gets crazy and requests incorrect parameter index
This commit is contained in:
@@ -89,10 +89,12 @@ int parametersCount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *getParameterName(int index) {
|
const char *getParameterName(int index) {
|
||||||
|
if (index < 0 || index >= parametersCount()) return "";
|
||||||
return parameters[index].name;
|
return parameters[index].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
float getParameter(int index) {
|
float getParameter(int index) {
|
||||||
|
if (index < 0 || index >= parametersCount()) return NAN;
|
||||||
return *parameters[index].variable;
|
return *parameters[index].variable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user