diff options
-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){ |