From 805046c354fa3aa132c7d5df985fabf035daf010 Mon Sep 17 00:00:00 2001 From: Nodenum Date: Mon, 17 Dec 2012 09:32:19 +0100 Subject: [PATCH] Fix bug #1356: .obj loading bug in picolib There's a bug in picolib when parsing the first group in an .obj file. The library tries to set the surface name to a surface pointer that is still NULL. This gets silently ignored but the problem reappears later in a warning message when the material or a face is parsed. --- libs/picomodel/pm_obj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/picomodel/pm_obj.c b/libs/picomodel/pm_obj.c index a089f5f4..49d0fe84 100644 --- a/libs/picomodel/pm_obj.c +++ b/libs/picomodel/pm_obj.c @@ -676,7 +676,7 @@ static picoModel_t *_obj_load( PM_PARAMS_LOAD ){ #endif } - if ( curFace == 0 ) { + if ( curFace == 0 && curSurface != NULL ) { PicoSetSurfaceName( curSurface,groupName ); } else -- 2.39.2