From d9eaa2076de595178071ba5095d655fe45088d08 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Mon, 8 Apr 2019 10:36:58 -0700 Subject: [PATCH] Fix out of bounds when the model url is incorrect --- libraries/hfm/src/hfm/HFM.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/hfm/src/hfm/HFM.cpp b/libraries/hfm/src/hfm/HFM.cpp index e930f30d1a..6a9a714234 100644 --- a/libraries/hfm/src/hfm/HFM.cpp +++ b/libraries/hfm/src/hfm/HFM.cpp @@ -166,7 +166,9 @@ void HFMModel::computeKdops() { glm::vec3(INV_SQRT_3, INV_SQRT_3, -INV_SQRT_3), glm::vec3(INV_SQRT_3, -INV_SQRT_3, -INV_SQRT_3) }; - + if (joints.size() != shapeVertices.size()) { + return; + } // now that all joints have been scanned compute a k-Dop bounding volume of mesh for (int i = 0; i < joints.size(); ++i) { HFMJoint& joint = joints[i];