diff --git a/test/main.c b/test/main.c index 6bf10b0..62ca3ac 100644 --- a/test/main.c +++ b/test/main.c @@ -55,7 +55,7 @@ void write(const char *filename, bool unpackpld(const char *filedata, unsigned int filesize, const char *filename) { - if (filedata == NULL || filesize <= 0) { + if (filedata == NULL || filesize <= 0 || filename == NULL) { return false; } struct PldHeader h; @@ -80,7 +80,7 @@ void exporttextures(const char *filedata, struct Texture *t = NULL; struct TextureBatchDescriptor *d = NULL; char * fmt = NULL; - if (filename == NULL || filesize == 0) { + if (filedata == NULL || filesize == 0) { return; } p = (struct TexturePack*)filedata;