Check pointers before using them in var init
This commit is contained in:
parent
2b4ffd1161
commit
7a6475c3f9
@ -119,12 +119,6 @@ static CvStatus icvPOSIT( CvPOSITObject *pObject, CvPoint2D32f *imagePoints,
|
|||||||
float diff = (float)criteria.epsilon;
|
float diff = (float)criteria.epsilon;
|
||||||
float inv_focalLength = 1 / focalLength;
|
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 */
|
/* Check bad arguments */
|
||||||
if( imagePoints == NULL )
|
if( imagePoints == NULL )
|
||||||
return CV_NULLPTR_ERR;
|
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 )
|
if( (criteria.type & CV_TERMCRIT_ITER) && criteria.max_iter <= 0 )
|
||||||
return CV_BADFACTOR_ERR;
|
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 )
|
while( !converged )
|
||||||
{
|
{
|
||||||
if( count == 0 )
|
if( count == 0 )
|
||||||
|
@ -614,11 +614,12 @@ cvGetHashedKey( CvFileStorage* fs, const char* str, int len, int create_missing
|
|||||||
CvStringHashNode* node = 0;
|
CvStringHashNode* node = 0;
|
||||||
unsigned hashval = 0;
|
unsigned hashval = 0;
|
||||||
int i, tab_size;
|
int i, tab_size;
|
||||||
CvStringHash* map = fs->str_hash;
|
|
||||||
|
|
||||||
if( !fs )
|
if( !fs )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
CvStringHash* map = fs->str_hash;
|
||||||
|
|
||||||
if( len < 0 )
|
if( len < 0 )
|
||||||
{
|
{
|
||||||
for( i = 0; str[i] != '\0'; i++ )
|
for( i = 0; str[i] != '\0'; i++ )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user