Skip to content

Commit

Permalink
check range for float
Browse files Browse the repository at this point in the history
  • Loading branch information
knonomura committed Nov 27, 2018
1 parent dd15282 commit 457bbf6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gstype_python.i
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,9 @@ static bool convertObjectToFloat(PyObject* value, float* floatValPtr) {
return false;
}
*floatValPtr = PyFloat_AsDouble(value);
return true;

return (*floatValPtr < std::numeric_limits<float>::max() &&
*floatValPtr > -1 *std::numeric_limits<float>::max());
}
}
}
Expand Down

0 comments on commit 457bbf6

Please sign in to comment.