fix transform code using a node space as an image space, accessing unallocated memory.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 2 May 2011 05:24:59 +0000 (05:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 2 May 2011 05:24:59 +0000 (05:24 +0000)
also remove bullet patch which has now been applied.

extern/bullet2/uninitialized_stack_vec.patch [deleted file]
source/blender/editors/transform/transform_generics.c

diff --git a/extern/bullet2/uninitialized_stack_vec.patch b/extern/bullet2/uninitialized_stack_vec.patch
deleted file mode 100644 (file)
index 96833b7..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
-===================================================================
---- src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp       (revision 34336)
-+++ src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp       (working copy)
-@@ -61,10 +61,12 @@
-       scaledAabbMin[0] = m_localScaling.getX() >= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
-       scaledAabbMin[1] = m_localScaling.getY() >= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
-       scaledAabbMin[2] = m_localScaling.getZ() >= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
-+      scaledAabbMin[3] = 0.0; /* otherwise un-initialized stack memory: uninitialized_stack_vec.patch, blender patch */
-       
-       scaledAabbMax[0] = m_localScaling.getX() <= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
-       scaledAabbMax[1] = m_localScaling.getY() <= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
-       scaledAabbMax[2] = m_localScaling.getZ() <= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
-+      scaledAabbMax[3] = 0.0; /* otherwise un-initialized stack memory: uninitialized_stack_vec.patch, blender patch */
-       
-       
-       m_bvhTriMeshShape->processAllTriangles(&scaledCallback,scaledAabbMin,scaledAabbMax);
index cf169dd587e47e8c54ffdb4f51706e11b2910246..8c7a39e5dff3ad986b3080a6eb16fd68b4e5a410 100644 (file)
@@ -1018,12 +1018,18 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
                        }
                }
        }
-       else if(t->spacetype==SPACE_IMAGE || t->spacetype==SPACE_NODE)
+       else if(t->spacetype==SPACE_IMAGE)
        {
                SpaceImage *sima = sa->spacedata.first;
-               // XXX for now, get View2D  from the active region
+               // XXX for now, get View2D from the active region
                t->view = &ar->v2d;
-               t->around = (sima ? sima->around : 0);
+               t->around = sima->around;
+       }
+       else if(t->spacetype==SPACE_NODE)
+       {
+               // XXX for now, get View2D from the active region
+               t->view = &ar->v2d;
+               t->around = V3D_CENTER;
        }
        else if(t->spacetype==SPACE_IPO) 
        {