shithub: libobj

Download patch

ref: ad65ff69d3ddeaf3b34cc9038bc28e79692f9656
parent: b4a0229a2dadca8c4d3a94d3e7176d022f09ec82
author: rodri <rgl@antares-labs.eu>
date: Tue Feb 20 11:50:13 EST 2024

don't try to find a material when the list is empty.

--- a/obj.c
+++ b/obj.c
@@ -738,7 +738,7 @@
 					*p++ = c;
 				}while(c = Bgetc(bin), (isalnum(c) || c == '.' || c == '_') && p-buf < sizeof(buf)-1);
 				*p = 0;
-				if((m = getmtl(obj->materials, buf)) == nil){
+				if(obj->materials != nil && (m = getmtl(obj->materials, buf)) == nil){
 					error("no material '%s' found", buf);
 					goto error;
 				}