diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-23 14:24:35 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-23 14:24:35 +0400 |
commit | 992a4e8e7a4da9e4f3f5dadbf996854da2bfd0bd (patch) | |
tree | 9f798de6cdc886b616aa4362285340350d108a9a | |
parent | 2567129e7fe7a2a4439ee6c9607d3eb5660e7d7c (diff) |
Fix a crash when failing to read .tga files in some cases.
-rw-r--r-- | source/blender/imbuf/intern/targa.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index 3c14189a292..09aaccc1ab6 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -592,8 +592,10 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, int mem_size, int flags) if (flags & IB_test) return (ibuf); if (tga.imgtyp != 1 && tga.imgtyp != 9) { /* happens sometimes (beuh) */ - MEM_freeN(cmap); - cmap= NULL; + if(cmap) { + MEM_freeN(cmap); + cmap= NULL; + } } switch(tga.imgtyp){ |