BSPX_AddLump: copy the input data

This commit is contained in:
Eric Wasylishen 2018-02-18 16:06:56 -07:00
parent 992484f173
commit 7b341e1b55
1 changed files with 5 additions and 1 deletions

View File

@ -2222,7 +2222,11 @@ void BSPX_AddLump(bspdata_t *bspdata, const char *xname, const void *xdata, size
bspdata->bspxentries = e;
}
e->lumpdata = xdata;
//ericw -- make a copy
byte *xdata_copy = (byte*) malloc(xsize);
memcpy(xdata_copy, xdata, xsize);
e->lumpdata = xdata_copy;
e->lumpsize = xsize;
}
const void *BSPX_GetLump(bspdata_t *bspdata, const char *xname, size_t *xsize)