From d505b745fc155ee0e417418bd947db69719c4aea Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 10 Feb 2011 15:47:55 +0000 Subject: 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 :) --- source/blender/imbuf/intern/allocimbuf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/imbuf') 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); -- cgit v1.2.3