Check pointers before using them in var init
This commit is contained in:
@@ -119,12 +119,6 @@ static CvStatus icvPOSIT( CvPOSITObject *pObject, CvPoint2D32f *imagePoints,
|
||||
float diff = (float)criteria.epsilon;
|
||||
float inv_focalLength = 1 / focalLength;
|
||||
|
||||
/* init variables */
|
||||
int N = pObject->N;
|
||||
float *objectVectors = pObject->obj_vecs;
|
||||
float *invMatrix = pObject->inv_matr;
|
||||
float *imgVectors = pObject->img_vecs;
|
||||
|
||||
/* Check bad arguments */
|
||||
if( imagePoints == NULL )
|
||||
return CV_NULLPTR_ERR;
|
||||
@@ -143,6 +137,12 @@ static CvStatus icvPOSIT( CvPOSITObject *pObject, CvPoint2D32f *imagePoints,
|
||||
if( (criteria.type & CV_TERMCRIT_ITER) && criteria.max_iter <= 0 )
|
||||
return CV_BADFACTOR_ERR;
|
||||
|
||||
/* init variables */
|
||||
int N = pObject->N;
|
||||
float *objectVectors = pObject->obj_vecs;
|
||||
float *invMatrix = pObject->inv_matr;
|
||||
float *imgVectors = pObject->img_vecs;
|
||||
|
||||
while( !converged )
|
||||
{
|
||||
if( count == 0 )
|
||||
|
Reference in New Issue
Block a user