From 8e7da8285275d41ebca3f9e747d5129a12b22d88 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Mon, 10 Jul 2017 01:41:39 +0900 Subject: [PATCH] Fix index calculation. --- experimental/tinyobj_loader_opt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/tinyobj_loader_opt.h b/experimental/tinyobj_loader_opt.h index ed44b47..f86b482 100644 --- a/experimental/tinyobj_loader_opt.h +++ b/experimental/tinyobj_loader_opt.h @@ -1331,7 +1331,7 @@ bool parseObj(attrib_t *attrib, std::vector *shapes, // Find extra line which spand across chunk boundary. if ((t < num_threads) && (buf[end_idx - 1] != '\n')) { - auto extra_span_idx = (std::min)(end_idx - 1 + chunk_size, len - 1); + auto extra_span_idx = (std::min)(end_idx - 1 + chunk_size, len); for (size_t i = end_idx; i < extra_span_idx; i++) { if (is_line_ending(buf, i, extra_span_idx)) { LineInfo info;