[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28617] branches/render25/source/blender/ imbuf/intern/cache.c: Fix tile cache crash, IMB_addrectImbuf could free mipmap levels on

Brecht Van Lommel brecht at blender.org
Thu May 6 16:43:57 CEST 2010


Revision: 28617
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28617
Author:   blendix
Date:     2010-05-06 16:43:56 +0200 (Thu, 06 May 2010)

Log Message:
-----------
Fix tile cache crash, IMB_addrectImbuf could free mipmap levels on
convert tiles to rect, but we want to keep them.

Modified Paths:
--------------
    branches/render25/source/blender/imbuf/intern/cache.c

Modified: branches/render25/source/blender/imbuf/intern/cache.c
===================================================================
--- branches/render25/source/blender/imbuf/intern/cache.c	2010-05-06 14:43:21 UTC (rev 28616)
+++ branches/render25/source/blender/imbuf/intern/cache.c	2010-05-06 14:43:56 UTC (rev 28617)
@@ -401,8 +401,15 @@
 	for(a=0; a<ibuf->miptot; a++) {
 		mipbuf= IMB_getmipmap(ibuf, a);
 
-		if(!imb_addrectImBuf(mipbuf))
-			break;
+		/* don't call imb_addrectImBuf, it frees all mipmaps */
+		if(!mipbuf->rect) {
+			if((mipbuf->rect = MEM_mapallocN(ibuf->x*ibuf->y*sizeof(unsigned int), "imb_addrectImBuf"))) {
+				mipbuf->mall |= IB_rect;
+				mipbuf->flags |= IB_rect;
+			}
+			else
+				break;
+		}
 
 		for(ty=0; ty<mipbuf->ytiles; ty++) {
 			for(tx=0; tx<mipbuf->xtiles; tx++) {





More information about the Bf-blender-cvs mailing list