diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-28 18:24:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-28 18:24:35 +0200 |
commit | 09254e970ad76647a2673c265769cd51ae28f616 (patch) | |
tree | 7d60f0fc448225205f4eced334cbe7a2a850494d /modules | |
parent | ce7f5992083bdebf2d828a0117d5197eff624710 (diff) | |
parent | d67c5afa95e3610e5c3db1c6a9850809eead3eb0 (diff) |
Merge pull request #49960 from fire/curve-interpolate-crash
Make curve interpolate crash less.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gltf/gltf_document.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 674403905a..a5080f9c41 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -5537,6 +5537,8 @@ struct EditorSceneImporterGLTFInterpolate<Quaternion> { template <class T> T GLTFDocument::_interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, const float p_time, const GLTFAnimation::Interpolation p_interp) { + ERR_FAIL_COND_V(!p_values.size(), T()); + ERR_FAIL_COND_V(p_times.size() != p_values.size(), p_values[0]); //could use binary search, worth it? int idx = -1; for (int i = 0; i < p_times.size(); i++) { |