#ifdef WIN32
dllname = "zlib.dll";
+#elif defined(MACOSX)
+ dllname = "libz.dylib";
#else
dllname = "libz.so";
#endif
remaining -= count;
}
- Mem_Free (central_dir);
+ // If the package is empty, central_dir is NULL here
+ if (central_dir != NULL)
+ Mem_Free (central_dir);
return pack->numfiles;
}
packlist = pack;
real_nb_files = PK3_BuildFileList (pack, &eocd);
- if (real_nb_files <= 0)
+ if (real_nb_files < 0)
Sys_Error ("%s is not a valid PK3 file", packfile);
Con_Printf("Added packfile %s (%i files)\n", packfile, real_nb_files);