Load raster category names fix

This commit is contained in:
Radim Blazek 2013-11-04 08:26:42 +01:00
parent d901e5065a
commit c59cd92c12

View File

@ -63,11 +63,14 @@ QList<QgsColorRampShader::ColorRampItem> QgsGdalProviderBase::colorTable( GDALDa
// load category labels
char ** categoryNames = GDALGetRasterCategoryNames( myGdalBand );
QVector<QString> labels;
int i = 0;
while ( categoryNames[i] )
if ( categoryNames )
{
labels.append( QString( categoryNames[i] ) );
i++;
int i = 0;
while ( categoryNames[i] )
{
labels.append( QString( categoryNames[i] ) );
i++;
}
}
int myEntryCount = GDALGetColorEntryCount( myGdalColorTable );