[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35984] trunk/blender/source/blender/ blenkernel/intern/texture.c: fix crash with previewing point density colorband, it wasnt being copied with the texture but was freed, making blenders own data point to freed memory.

Campbell Barton ideasman42 at gmail.com
Mon Apr 4 01:35:21 CEST 2011


Revision: 35984
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35984
Author:   campbellbarton
Date:     2011-04-03 23:35:20 +0000 (Sun, 03 Apr 2011)
Log Message:
-----------
fix crash with previewing point density colorband, it wasnt being copied with the texture but was freed, making blenders own data point to freed memory.

found in bug report [#26767].

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/texture.c

Modified: trunk/blender/source/blender/blenkernel/intern/texture.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/texture.c	2011-04-03 23:11:00 UTC (rev 35983)
+++ trunk/blender/source/blender/blenkernel/intern/texture.c	2011-04-03 23:35:20 UTC (rev 35984)
@@ -795,7 +795,13 @@
 		texn->env= BKE_copy_envmap(texn->env);
 		id_us_min(&texn->env->ima->id);
 	}
-	if(texn->pd) texn->pd= MEM_dupallocN(texn->pd);
+	if(texn->pd) {
+		texn->pd= MEM_dupallocN(texn->pd);
+		if(texn->pd->coba) {
+			texn->pd->coba= MEM_dupallocN(texn->pd->coba);
+		}
+
+	}
 	if(texn->vd) {
 		texn->vd= MEM_dupallocN(texn->vd);
 		if(texn->vd->dataset)




More information about the Bf-blender-cvs mailing list