fix index comparison wrt array size

This commit is contained in:
Vincent de Marignac
2018-08-15 23:41:35 +03:00
parent 8a885e14b8
commit fdc70abdc6

View File

@@ -2161,9 +2161,9 @@ bool LoadObj(attrib_t *attrib, std::vector<shape_t> *shapes,
// Ignore unknown command. // Ignore unknown command.
} }
if (greatest_vertex_index >= v.size() if (greatest_vertex_index * 3 >= int(v.size())
|| greatest_normal_index >= vn.size() || greatest_normal_index * 3 >= int(vn.size())
|| greatest_texcoord_index >= vt.size()) || greatest_texcoord_index * 2 >= int(vt.size()))
{ {
if (err) { if (err) {
std::stringstream ss; std::stringstream ss;