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>2007-07-12 15:51:21 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-07-12 15:51:21 +0400
commitbfb9603cb47e524439d76f1ec303423b8ab8e9c3 (patch)
treef56bb85b85e262d918c7938073f98c0b6cb3ea9c /source/blender/python/api2_2x/Texture.c
parente7c15b97e24c1923df8bef96ac35f9abd17c7964 (diff)
From stable
Revision: 11237 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11237 Author: campbellbarton Date: 2007-07-12 13:05:31 +0200 (Thu, 12 Jul 2007) Log Message: ----------- PyObject_IsTrue was missing a check for an error return value in many cases.
Diffstat (limited to 'source/blender/python/api2_2x/Texture.c')
-rw-r--r--source/blender/python/api2_2x/Texture.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c
index 11a869d0b7c..1387b630a2c 100644
--- a/source/blender/python/api2_2x/Texture.c
+++ b/source/blender/python/api2_2x/Texture.c
@@ -1406,7 +1406,12 @@ static int Texture_setAnimFrames( BPy_Texture * self, PyObject * value )
static int Texture_setIUserCyclic( BPy_Texture * self, PyObject * value )
{
- if( PyObject_IsTrue( value ) )
+ int param = PyObject_IsTrue( value );
+ if( param == -1 )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected True/False or 0/1" );
+
+ if( param )
self->texture->iuser.cycl = 1;
else
self->texture->iuser.cycl = 0;
@@ -1623,7 +1628,12 @@ static int Texture_setImageFlags( BPy_Texture * self, PyObject * value,
static int Texture_setIUserFlags( BPy_Texture * self, PyObject * value,
void *flag )
{
- if( PyObject_IsTrue(value) )
+ int param = PyObject_IsTrue( value );
+ if( param == -1 )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected True/False or 0/1" );
+
+ if( param )
self->texture->iuser.flag |= (int)flag;
else
self->texture->iuser.flag &= ~(int)flag;