Fix Divide-by-zero in vector3
Fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29655
This commit is contained in:
@@ -154,6 +154,9 @@ const aiVector3t<TReal>& aiVector3t<TReal>::operator *= (TReal f) {
|
||||
template <typename TReal>
|
||||
AI_FORCE_INLINE
|
||||
const aiVector3t<TReal>& aiVector3t<TReal>::operator /= (TReal f) {
|
||||
if ((T) f==0.0) {
|
||||
return *this;
|
||||
}
|
||||
const TReal invF = (TReal) 1.0 / f;
|
||||
x *= invF;
|
||||
y *= invF;
|
||||
|
||||
Reference in New Issue
Block a user