Add zero-value check when parsing `f' line. Fixes #140.

This commit is contained in:
Syoyo Fujita
2017-09-25 02:30:24 +09:00
parent 7c7335c907
commit 75a4bd1d35
4 changed files with 115 additions and 36 deletions

View File

@@ -643,6 +643,23 @@ TEST_CASE("norm_texopts", "[norm]") {
}
TEST_CASE("zero-face-idx-value", "[Issue140]") {
tinyobj::attrib_t attrib;
std::vector<tinyobj::shape_t> shapes;
std::vector<tinyobj::material_t> materials;
std::string err;
bool ret = tinyobj::LoadObj(&attrib, &shapes, &materials, &err, "../models/issue-140-zero-face-idx.obj", gMtlBasePath);
if (!err.empty()) {
std::cerr << err << std::endl;
}
REQUIRE(false == ret);
REQUIRE(!err.empty());
}
#if 0
int
main(