From 6a24dd8945cf454e7bbe50bc597c051698d1a8bf Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 28 Mar 2021 20:51:29 +0200 Subject: [PATCH] REVIEWED: tinyobjloader #1568 --- src/external/tinyobj_loader_c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/external/tinyobj_loader_c.h b/src/external/tinyobj_loader_c.h index 242b47d8..6bd63fce 100644 --- a/src/external/tinyobj_loader_c.h +++ b/src/external/tinyobj_loader_c.h @@ -1377,7 +1377,7 @@ int tinyobj_parse_obj(tinyobj_attrib_t *attrib, tinyobj_shape_t **shapes, /* Create a null terminated string */ char* material_name_null_term = (char*) TINYOBJ_MALLOC(commands[i].material_name_len + 1); memcpy((void*) material_name_null_term, (const void*) commands[i].material_name, commands[i].material_name_len); - material_name_null_term[commands[i].material_name_len - 1] = 0; + material_name_null_term[commands[i].material_name_len] = 0; if (hash_table_exists(material_name_null_term, &material_table)) material_id = (int)hash_table_get(material_name_null_term, &material_table);