Changeset 11398

Show
Ignore:
Timestamp:
05/02/07 15:45:05 (2 years ago)
Author:
dmorissette
Message:

Check for NULL pszColor in OGRStyleTool::GetRGBFromString() (#1571)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/ogr/ogrfeaturestyle.cpp

    r10630 r11398  
    855855                                     int &nTransparance) 
    856856{ 
    857    int nCount
     857   int nCount=0
    858858    
    859859   nTransparance = 255; 
    860860 
    861861   // FIXME: should we really use sscanf here? 
    862    nCount  = sscanf(pszColor,"#%2x%2x%2x%2x",&nRed,&nGreen,&nBlue,  
    863                     &nTransparance); 
     862   if (pszColor) 
     863       nCount  = sscanf(pszColor,"#%2x%2x%2x%2x",&nRed,&nGreen,&nBlue,  
     864                        &nTransparance); 
    864865    
    865866   if (nCount >=3)