Skip to content

Commit

Permalink
GDALPamRasterBand::CloneInfo(): do not clone empty RAT
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 5, 2018
1 parent 41b212d commit 2463883
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gdal/gcore/gdalpamrasterband.cpp
Expand Up @@ -662,7 +662,8 @@ CPLErr GDALPamRasterBand::CloneInfo( GDALRasterBand *poSrcBand,
{
const GDALRasterAttributeTable *poRAT = poSrcBand->GetDefaultRAT();

if( poRAT != nullptr )
if( poRAT != nullptr &&
(poRAT->GetRowCount() != 0 || poRAT->GetColumnCount() != 0) )
{
if( !bOnlyIfMissing || GetDefaultRAT() == nullptr )
{
Expand Down

0 comments on commit 2463883

Please sign in to comment.