From 5b40ffb00b02500028318a606af83478073ff71e Mon Sep 17 00:00:00 2001 From: _ <_> Date: Fri, 6 Apr 2018 20:18:27 -0700 Subject: [PATCH] Added check for file data on exporttextures() --- test/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;