]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Fix bug #1356: .obj loading bug in picolib
authorNodenum <Nodenum@dev.xonotic.org.invalid>
Mon, 17 Dec 2012 08:32:19 +0000 (09:32 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 17 Dec 2012 08:32:19 +0000 (09:32 +0100)
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

index a089f5f44c1be4dbd1b493f84b23638aa7a631fd..49d0fe84ed264e253f01b41abfcc961163c3fc22 100644 (file)
@@ -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