Skip to content

Commit

Permalink
Load raster category names fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Nov 4, 2013
1 parent d901e50 commit c59cd92
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/providers/gdal/qgsgdalproviderbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit c59cd92

Please sign in to comment.