[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18474] trunk/blender/source/blender/ python/api2_2x/sceneSequence.c: fix for big in yesterdays commit, color values were not initialized

Campbell Barton ideasman42 at gmail.com
Tue Jan 13 06:55:50 CET 2009


Revision: 18474
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18474
Author:   campbellbarton
Date:     2009-01-13 06:55:48 +0100 (Tue, 13 Jan 2009)

Log Message:
-----------
fix for big in yesterdays commit, color values were not initialized

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/sceneSequence.c

Modified: trunk/blender/source/blender/python/api2_2x/sceneSequence.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/sceneSequence.c	2009-01-13 05:46:12 UTC (rev 18473)
+++ trunk/blender/source/blender/python/api2_2x/sceneSequence.c	2009-01-13 05:55:48 UTC (rev 18474)
@@ -144,11 +144,20 @@
 	seq = alloc_sequence(seqbase, start, machine); /* warning, this sets last */
 
 
-	if (PyArg_ParseTuple( py_data, "iO!|O!O!", &type, &Sequence_Type, &pyob1, &Sequence_Type, &pyob2, &Sequence_Type, &pyob3)) {
+	if (PyTuple_Check(py_data) && PyTuple_GET_SIZE(py_data) >= 2 && BPy_Sequence_Check(PyTuple_GET_ITEM(py_data, 1))) {
 	
 		struct SeqEffectHandle sh;
 		Sequence *seq1, *seq2= NULL, *seq3= NULL; /* for effects */
 
+		if (!PyArg_ParseTuple( py_data, "iO!|O!O!", &type, &Sequence_Type, &pyob1, &Sequence_Type, &pyob2, &Sequence_Type, &pyob3)) {
+			BLI_remlink(seqbase, seq);
+			free_sequence(seq);
+			
+			return EXPP_ReturnPyObjError( PyExc_ValueError,
+				"effect stripts expected an effect type int and 1 to 3 sequence strips");
+		}
+
+
 		seq1= ((BPy_Sequence *)pyob1)->seq;
 		if(pyob2) seq2= ((BPy_Sequence *)pyob2)->seq;
 		if(pyob3) seq3= ((BPy_Sequence *)pyob3)->seq;
@@ -260,6 +269,8 @@
 		}
 
 		seq->effectdata = MEM_callocN(sizeof(struct SolidColorVars), "solidcolor");
+		colvars= (SolidColorVars *)seq->effectdata;
+
 		seq->type= SEQ_COLOR;
 		
 		CLAMP(r,0,1);





More information about the Bf-blender-cvs mailing list