diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-20 18:49:12 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-20 18:49:12 +0400 |
commit | 2af7bb8aaff41afffd336d4785713591e6f960eb (patch) | |
tree | cb98ca49c30d99c54136dd6550a19d977d7484d9 /source | |
parent | f198961ebcf1d6cb84a58d52d9ca6851cce2fbc4 (diff) |
Fix for BLI_ungzip_to_mem: it'll return NULL now if file is not found.
It makes default bfont used if unifont isn't found. Useful for install-less
launch when debugging.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 6b125435b31..9ccd7fbe121 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -136,7 +136,11 @@ char *BLI_ungzip_to_mem(const char *from_file, int *size_r) else break; } - if(mem && alloc_size!=size) + if(size==0) { + MEM_freeN(mem); + mem= NULL; + } + else if(alloc_size!=size) mem= MEM_reallocN(mem, size); *size_r= size; |