Changeset 11399

Show
Ignore:
Timestamp:
05/02/07 16:10:00 (1 year ago)
Author:
warmerdam
Message:

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

Files:

Legend:

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

    r10646 r11399  
    849849                                     int &nTransparance) 
    850850{ 
    851    int nCount
     851   int nCount = 0
    852852    
    853853   nTransparance = 255; 
    854854 
    855855   // FIXME: should we really use sscanf here? 
    856    nCount  = sscanf(pszColor,"#%2x%2x%2x%2x",&nRed,&nGreen,&nBlue,  
    857                     &nTransparance); 
     856   if( pszColor ) 
     857       nCount  = sscanf(pszColor,"#%2x%2x%2x%2x",&nRed,&nGreen,&nBlue,  
     858                        &nTransparance); 
    858859    
    859860   if (nCount >=3)