Added check for file data on exporttextures()

This commit is contained in:
_ 2018-04-06 20:18:27 -07:00
parent f884d0bf58
commit 5b40ffb00b

View File

@ -55,7 +55,7 @@ void write(const char *filename,
bool unpackpld(const char *filedata, bool unpackpld(const char *filedata,
unsigned int filesize, unsigned int filesize,
const char *filename) { const char *filename) {
if (filedata == NULL || filesize <= 0) { if (filedata == NULL || filesize <= 0 || filename == NULL) {
return false; return false;
} }
struct PldHeader h; struct PldHeader h;
@ -80,7 +80,7 @@ void exporttextures(const char *filedata,
struct Texture *t = NULL; struct Texture *t = NULL;
struct TextureBatchDescriptor *d = NULL; struct TextureBatchDescriptor *d = NULL;
char * fmt = NULL; char * fmt = NULL;
if (filename == NULL || filesize == 0) { if (filedata == NULL || filesize == 0) {
return; return;
} }
p = (struct TexturePack*)filedata; p = (struct TexturePack*)filedata;