Commit 58894ce5 authored by Thomas Debesse's avatar Thomas Debesse

bsp lump write: pad with zeros, not with random unitialized memory data

parent 35b8ead7
......@@ -341,14 +341,17 @@ int CopyLump_Allocate( bspHeader_t *header, int lump, void **dest, int size, int
void AddLump( FILE *file, bspHeader_t *header, int lumpNum, const void *data, int length ){
bspLump_t *lump;
/* add lump to bsp file header */
lump = &header->lumps[ lumpNum ];
lump->offset = LittleLong( ftell( file ) );
lump->length = LittleLong( length );
/* write lump to file */
SafeWrite( file, data, ( length + 3 ) & ~3 );
SafeWrite( file, data, length );
/* write padding zeros */
char *zeros[3] = { 0, 0, 0 };
  • This is array 3 of NULL pointers to char, not what was meant.

Please register or sign in to reply
SafeWrite( file, zeros, ( ( length + 3 ) & ~3 ) - length );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment