Skip to content
Snippets Groups Projects
Commit 36abceed authored by Stephen Swaney's avatar Stephen Swaney
Browse files

bugfix: #2025 getCurveBP (and others) segfault

This method is now unsupported.  The original intent appears to
return the first BPoint of an Ipo curve.  However, BPoint Ipo curves
are not implemented and the first point therefore never existed.

The segfault was from an unchecked input parameter.

Calling this method now always throws a NotImplemented exception.
parent ee810028
No related branches found
No related tags found
No related merge requests found
...@@ -1235,8 +1235,25 @@ static PyObject *Ipo_DeleteBezPoints( BPy_Ipo * self, PyObject * args ) ...@@ -1235,8 +1235,25 @@ static PyObject *Ipo_DeleteBezPoints( BPy_Ipo * self, PyObject * args )
} }
/*
* Ipo_getCurveBP()
* this method is UNSUPPORTED.
* Calling this method throws a TypeError Exception.
*
* it looks like the original intent was to return the first point
* of a BPoint Ipo curve. However, BPoint ipos are not currently
* implemented.
*/
static PyObject *Ipo_getCurveBP( BPy_Ipo * self, PyObject * args ) static PyObject *Ipo_getCurveBP( BPy_Ipo * self, PyObject * args )
{ {
/* unsupported method */
return EXPP_ReturnPyObjError( PyExc_NotImplementedError,
"bpoint ipos are not supported");
#if 0
struct BPoint *ptrbpoint; struct BPoint *ptrbpoint;
int num = 0, i; int num = 0, i;
IpoCurve *icu; IpoCurve *icu;
...@@ -1265,6 +1282,7 @@ static PyObject *Ipo_getCurveBP( BPy_Ipo * self, PyObject * args ) ...@@ -1265,6 +1282,7 @@ static PyObject *Ipo_getCurveBP( BPy_Ipo * self, PyObject * args )
for( i = 0; i < 4; i++ ) for( i = 0; i < 4; i++ )
PyList_Append( l, PyFloat_FromDouble( ptrbpoint->vec[i] ) ); PyList_Append( l, PyFloat_FromDouble( ptrbpoint->vec[i] ) );
return l; return l;
#endif
} }
static PyObject *Ipo_getCurveBeztriple( BPy_Ipo * self, PyObject * args ) static PyObject *Ipo_getCurveBeztriple( BPy_Ipo * self, PyObject * args )
......
...@@ -178,13 +178,11 @@ class Ipo: ...@@ -178,13 +178,11 @@ class Ipo:
def getCurveBP(curvepos): def getCurveBP(curvepos):
""" """
Gets the basepoint of a curve of the ipo. This method is unsupported. BPoint Ipo curves are not implemented.
@type curvepos: int Calling this method throws a NotImplementedError exception.
@param curvepos: the position of the curve. @raise NotImplementedError: this method B{always} raises an exception
@rtype: a list of 4 floats
@return: the coordinates of the basepoint, or an error is raised.
""" """
def getBeztriple(curvepos,pointpos): def getBeztriple(curvepos,pointpos):
""" """
Gets a beztriple of the Ipo. Gets a beztriple of the Ipo.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment