[Gdal-dev] gcore\gdal_rat.cpp typo and logical errors

Lucena, Ivan ivan.lucena at pmldnet.com
Fri Jun 29 09:09:03 EDT 2007


Hi there,

#1 - There is a missing "h" at:

"In the general case each row as a column indicating the minimum pixel"

[http://trac.osgeo.org/gdal/browser/trunk/gdal/gcore/gdal_rat.cpp#L54]

It looks like someone is imitating my writing style :-), but I guess 
that the fix would be:

"In the general case each row has a column indicating the minimum pixel"

#2 - And a missing variable assignment to the returning value of a 
function call at:

1239 	        if( iMaxCol == -1 )
1240 	            GetColOfUsage( GFU_MinMax );
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[http://trac.osgeo.org/gdal/browser/trunk/gdal/gcore/gdal_rat.cpp#L1240]

The fix is probably something like that:

1236 	        int  iMaxCol;
1237 	
1238 	        iMaxCol = GetColOfUsage( GFU_Max );
1239 	        if( iMaxCol == -1 )
1240 	            iMaxCol = GetColOfUsage( GFU_MinMax );
                     ^^^^^^^^^^
1241 	
1242 	        if( iMaxCol == -1 || nRowCount == 0 )
1243 	            return NULL;

I would be happy to commit it if that is OK.

Best regards,

Ivan



More information about the Gdal-dev mailing list