]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
fix drawindexes crash when loading BSP files
authorRudolf Polzer <divverent@alientrap.org>
Mon, 13 Feb 2012 20:09:11 +0000 (21:09 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 13 Feb 2012 20:09:11 +0000 (21:09 +0100)
tools/quake3/q3map2/bspfile_ibsp.c
tools/quake3/q3map2/bspfile_rbsp.c

index 77ffd704a747586e705744b26e1bff89b1b4b10e..221df3ce36eda8c08ecac788c5e64479b0cc14e6 100644 (file)
@@ -501,7 +501,7 @@ void LoadIBSPFile( const char *filename )
        
        numBSPFogs = CopyLump( (bspHeader_t*) header, LUMP_FOGS, bspFogs, sizeof( bspFog_t ) ); // TODO fix overflow
        
-       numBSPDrawIndexes = CopyLump( (bspHeader_t*) header, LUMP_DRAWINDEXES, bspDrawIndexes, sizeof( bspDrawIndexes[ 0 ] ) );
+       numBSPDrawIndexes = CopyLump_Allocate( (bspHeader_t*) header, LUMP_DRAWINDEXES, (void **) &bspDrawIndexes, sizeof( bspDrawIndexes[ 0 ] ), &allocatedBSPDrawIndexes );
        
        numBSPVisBytes = CopyLump( (bspHeader_t*) header, LUMP_VISIBILITY, bspVisBytes, 1 ); // TODO fix overflow
        
index 644f1f5f97c8289673e7c04386f3a129cc5ff5ec..22ead1844b626d02e5e0259012143f8fa90ec6ee 100644 (file)
@@ -257,7 +257,7 @@ void LoadRBSPFile( const char *filename )
        
        numBSPFogs = CopyLump( (bspHeader_t*) header, LUMP_FOGS, bspFogs, sizeof( bspFogs[ 0 ] ) );
        
-       numBSPDrawIndexes = CopyLump( (bspHeader_t*) header, LUMP_DRAWINDEXES, bspDrawIndexes, sizeof( bspDrawIndexes[ 0 ] ) );
+       numBSPDrawIndexes = CopyLump_Allocate( (bspHeader_t*) header, LUMP_DRAWINDEXES, (void **) &bspDrawIndexes, sizeof( bspDrawIndexes[ 0 ] ), &allocatedBSPDrawIndexes );
        
        numBSPVisBytes = CopyLump( (bspHeader_t*) header, LUMP_VISIBILITY, bspVisBytes, 1 );