diff options
-rw-r--r-- | util.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -157,6 +157,11 @@ void* file_raw(char *path, uint32_t *size) | |||
157 | 157 | ||
158 | fseek(file, 0, SEEK_END); | 158 | fseek(file, 0, SEEK_END); |
159 | len = ftell(file); | 159 | len = ftell(file); |
160 | if(len <= 0) | ||
161 | { | ||
162 | fclose(file); | ||
163 | return NULL; | ||
164 | } | ||
160 | data = malloc(len); | 165 | data = malloc(len); |
161 | if(!data) { | 166 | if(!data) { |
162 | fclose(file); | 167 | fclose(file); |