Changeset 11399


Ignore:
Timestamp:
May 2, 2007, 1:10:00 PM (17 years ago)
Author:
warmerdam
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)
Note: See TracChangeset for help on using the changeset viewer.