From 35889026d6027b4df785cf478f4b3a96980eed95 Mon Sep 17 00:00:00 2001 From: Chris Liebert Date: Fri, 7 Oct 2016 21:21:33 -0700 Subject: [PATCH] added additional bounds checking --- examples/viewer/viewer.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/viewer/viewer.cc b/examples/viewer/viewer.cc index 3bce085..323faac 100644 --- a/examples/viewer/viewer.cc +++ b/examples/viewer/viewer.cc @@ -249,10 +249,9 @@ bool LoadObjAndConvert(float bmin[3], float bmax[3], { for (size_t s = 0; s < shapes.size(); s++) { size_t current_material_id = 0; - if (shapes[s].mesh.material_ids.size() > 0) { + if (shapes[s].mesh.material_ids.size() > 0 && shapes[s].mesh.material_ids.size() > s) { // Base case current_material_id = shapes[s].mesh.material_ids[s]; - std::cerr << "Setting base case: " << current_material_id << std::endl; } DrawObject o; std::vector vb; // pos(3float), normal(3float), color(3float)