Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-10-02 17:59:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-02 17:59:05 +0400
commit62c151bd1c15b1f74b2b23736e06e5b43627381c (patch)
treefec292545df8668bd6d0cf67d6c09a9588550fcb /source/blender
parent75fff053483341d1b163c14bf6b18019c077f5dd (diff)
freeing node trees no longer decreases their user counts, this cause causing invalid memory access when freeing the blend file.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/node.c8
-rw-r--r--source/blender/compositor/operations/COM_ZCombineOperation.cpp8
2 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index ade418e409f..1760b3ad03a 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1047,7 +1047,15 @@ void ntreeFreeTree_ex(bNodeTree *ntree, const short do_id_user)
/* same as ntreeFreeTree_ex but always manage users */
void ntreeFreeTree(bNodeTree *ntree)
{
+ /* XXX, this is correct, however when freeing the entire database
+ * this ends up accessing freed data which isn't properly unlinking
+ * its self from scene nodes, SO - for now prefer invalid usercounts
+ * on free rather then bad memory access - Campbell */
+#if 0
ntreeFreeTree_ex(ntree, TRUE);
+#else
+ ntreeFreeTree_ex(ntree, FALSE);
+#endif
}
void ntreeFreeCache(bNodeTree *ntree)
diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.cpp b/source/blender/compositor/operations/COM_ZCombineOperation.cpp
index c3ae42a6d8a..5e4f90b0269 100644
--- a/source/blender/compositor/operations/COM_ZCombineOperation.cpp
+++ b/source/blender/compositor/operations/COM_ZCombineOperation.cpp
@@ -79,10 +79,10 @@ void ZCombineAlphaOperation::executePixel(float output[4], float x, float y, Pix
}
float fac = color1[3];
float ifac = 1.0f - fac;
- output[0] = fac*color1[0] + ifac * color2[0];
- output[1] = fac*color1[1] + ifac * color2[1];
- output[2] = fac*color1[2] + ifac * color2[2];
- output[3] = MAX2(color1[3], color2[3]);
+ output[0] = fac * color1[0] + ifac * color2[0];
+ output[1] = fac * color1[1] + ifac * color2[1];
+ output[2] = fac * color1[2] + ifac * color2[2];
+ output[3] = max(color1[3], color2[3]);
}
void ZCombineOperation::deinitExecution()