From: Nodenum Date: Mon, 17 Dec 2012 08:32:19 +0000 (+0100) Subject: Fix bug #1356: .obj loading bug in picolib X-Git-Tag: xonotic-v0.7.0~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=805046c354fa3aa132c7d5df985fabf035daf010;p=xonotic%2Fnetradiant.git 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. --- 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