diff options
author | Ton Roosendaal <ton@blender.org> | 2011-02-10 18:47:55 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-02-10 18:47:55 +0300 |
commit | d505b745fc155ee0e417418bd947db69719c4aea (patch) | |
tree | f1cc9aebf025e5d8c11b24b834ef4f56c65c34b9 /source/blender/imbuf | |
parent | d240206c8853aa4a18f0e05087e3166e491cdf9c (diff) |
Bugfix #26001
Adding a byte rect to float ImBuf was always freeing the mipmap levels.
Removed this convention since it crashes renders + image texture draw.
Proper ownership handling of ImBuf is high on the wish list :)
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/allocimbuf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index fa823169966..32284472163 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -299,8 +299,12 @@ short imb_addrectImBuf(ImBuf *ibuf) int size; if(ibuf==NULL) return FALSE; - imb_freerectImBuf(ibuf); - + + /* don't call imb_freerectImBuf, it frees mipmaps, this call is used only too give float buffers display */ + if(ibuf->rect && (ibuf->mall & IB_rect)) + MEM_freeN(ibuf->rect); + ibuf->rect= NULL; + size = ibuf->x*ibuf->y; size = size*sizeof(unsigned int); |