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:
authorKen Hughes <khughes@pacific.edu>2006-08-31 01:45:27 +0400
committerKen Hughes <khughes@pacific.edu>2006-08-31 01:45:27 +0400
commitb4717d93a4699c072cfb98b865552bfaad20e099 (patch)
tree0094117e1a9ea80a8110063109eec5abb9da8a19 /source/blender/python/api2_2x/NLA.c
parent20818be156fcc976d61d9156fa18e7723c5f0ad0 (diff)
===Python API===
Fix uninitialized pointer bug in ActionStrips.remove(), caused by too zealous code optimization and insufficnet gcc warning flags. Thanks to Roland for catching it.
Diffstat (limited to 'source/blender/python/api2_2x/NLA.c')
-rw-r--r--source/blender/python/api2_2x/NLA.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/python/api2_2x/NLA.c b/source/blender/python/api2_2x/NLA.c
index b25444226f9..dadfe239f26 100644
--- a/source/blender/python/api2_2x/NLA.c
+++ b/source/blender/python/api2_2x/NLA.c
@@ -1277,10 +1277,11 @@ static PySequenceMethods ActionStrips_as_sequence = {
* helper function to check for a valid action strip argument
*/
-static bActionStrip *locate_strip( BPy_ActionStrips *self, PyObject * args )
+static bActionStrip *locate_strip( BPy_ActionStrips *self,
+ PyObject *args, BPy_ActionStrip **stripobj )
{
- BPy_ActionStrip *pyobj;
bActionStrip *strip = NULL;
+ BPy_ActionStrip *pyobj;
/* check that argument is a constraint */
if( !PyArg_ParseTuple( args, "O!", &ActionStrip_Type, &pyobj ) ) {
@@ -1295,6 +1296,10 @@ static bActionStrip *locate_strip( BPy_ActionStrips *self, PyObject * args )
return NULL;
}
+ /* if caller needs the object, return it */
+ if( stripobj )
+ *stripobj = pyobj;
+
/* find the action strip in the NLA */
for( strip = self->ob->nlastrips.first; strip; strip = strip->next )
if( strip == pyobj->strip )
@@ -1313,7 +1318,7 @@ static bActionStrip *locate_strip( BPy_ActionStrips *self, PyObject * args )
static PyObject *ActionStrips_remove( BPy_ActionStrips *self, PyObject * args )
{
BPy_ActionStrip *pyobj;
- bActionStrip *strip = locate_strip( self, args );
+ bActionStrip *strip = locate_strip( self, args, &pyobj );
/* return exception if we can't find the strip */
if( !strip )
@@ -1334,7 +1339,7 @@ static PyObject *ActionStrips_remove( BPy_ActionStrips *self, PyObject * args )
static PyObject *ActionStrips_moveUp( BPy_ActionStrips *self, PyObject * args )
{
- bActionStrip *strip = locate_strip( self, args );
+ bActionStrip *strip = locate_strip( self, args, NULL );
/* return exception if we can't find the strip */
if( !strip )
@@ -1355,7 +1360,7 @@ static PyObject *ActionStrips_moveUp( BPy_ActionStrips *self, PyObject * args )
static PyObject *ActionStrips_moveDown( BPy_ActionStrips *self, PyObject * args )
{
- bActionStrip *strip = locate_strip( self, args );
+ bActionStrip *strip = locate_strip( self, args, NULL );
/* return exception if we can't find the strip */
if( !strip )