Check pointers before using them in var init

This commit is contained in:
Andy Maloney
2013-01-28 16:51:28 -05:00
parent 2b4ffd1161
commit 7a6475c3f9
2 changed files with 8 additions and 7 deletions

View File

@@ -614,11 +614,12 @@ cvGetHashedKey( CvFileStorage* fs, const char* str, int len, int create_missing
CvStringHashNode* node = 0;
unsigned hashval = 0;
int i, tab_size;
CvStringHash* map = fs->str_hash;
if( !fs )
return 0;
CvStringHash* map = fs->str_hash;
if( len < 0 )
{
for( i = 0; str[i] != '\0'; i++ )