]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
q3map2: fix segfault when missing bspfile arg on light stage 161/head
authorThomas Debesse <dev@illwieckz.net>
Fri, 27 Mar 2020 00:52:28 +0000 (01:52 +0100)
committerThomas Debesse <dev@illwieckz.net>
Fri, 27 Mar 2020 00:53:22 +0000 (01:53 +0100)
tools/quake3/q3map2/light.c

index e43906e0aadfc87f34a0636f5424a66d3c65b4a3..79098148cbe5c503b33cf27497ed6c33fe486ec8 100644 (file)
@@ -2981,6 +2981,11 @@ int LightMain( int argc, char **argv ){
                Sys_Printf( "Restricted lightmap searching enabled - block size adjusted to %d\n", lightmapSearchBlockSize );
        }
 
+       /* arg checking */
+       if ( i != ( argc - 1 ) ) {
+               Error( "usage: q3map -light [options] <bspfile>" );
+       }
+
        strcpy( source, ExpandArg( argv[ i ] ) );
        StripExtension( source );
        DefaultExtension( source, ".map" );