Color proofing support with lcms (http://www.littlecms.com/).
[blender.git] / source / blender / imbuf / intern / allocimbuf.c
index ad7b1dce2e09f3640d742050d921f5246032c50c..b561f0a583dda1703160f5c080b8e0bc75f4e1ec 100644 (file)
@@ -93,6 +93,10 @@ void imb_freerectImBuf(struct ImBuf * ibuf)
 {
        if (ibuf==NULL) return;
        
+       if (ibuf->crect && ibuf->crect != ibuf->rect) {
+               MEM_freeN(ibuf->crect);
+       }
+
        if (ibuf->rect) {
                if (ibuf->mall & IB_rect) {
                        MEM_freeN(ibuf->rect);
@@ -102,6 +106,7 @@ void imb_freerectImBuf(struct ImBuf * ibuf)
        imb_freemipmapImBuf(ibuf);
        
        ibuf->rect= NULL;
+       ibuf->crect= NULL;
        ibuf->mall &= ~IB_rect;
 }