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.
This commit is contained in:
@@ -1095,7 +1095,12 @@ static int Image_setSource( BPy_Image *self, PyObject *args)
|
||||
|
||||
static int Image_setFlag(BPy_Image *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->image->flag |= (int)flag;
|
||||
else
|
||||
self->image->flag &= ~(int)flag;
|
||||
@@ -1104,7 +1109,12 @@ static int Image_setFlag(BPy_Image *self, PyObject *value, void *flag)
|
||||
|
||||
static int Image_setFlagTpage(BPy_Image *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->image->tpageflag |= (int)flag;
|
||||
else
|
||||
self->image->tpageflag &= ~(int)flag;
|
||||
|
||||
Reference in New Issue
Block a user