Skip to content
Permalink
Browse files

skip raster nuller with color types; check data block allocation in b…

…lock value read, fixes possibly #7807
  • Loading branch information
blazek committed May 14, 2013
1 parent 4ac52cf commit c0dec5a47b96a465b0a1acb1e13361e3152795b7
Showing with 17 additions and 2 deletions.
  1. +5 −0 src/core/raster/qgsrasterblock.h
  2. +12 −2 src/core/raster/qgsrasternuller.cpp
@@ -443,6 +443,11 @@ inline void QgsRasterBlock::writeValue( void *data, QGis::DataType type, size_t

inline double QgsRasterBlock::value( size_t index ) const
{
if ( !mData )
{
QgsDebugMsg( "Data block not allocated" );
return std::numeric_limits<double>::quiet_NaN();
}
return readValue( mData, mDataType, index );
}

@@ -74,11 +74,21 @@ QgsRasterBlock * QgsRasterNuller::block( int bandNo, QgsRectangle const & exten
QgsDebugMsg( "Entered" );
if ( !mInput )
{
QgsRasterBlock *outputBlock = new QgsRasterBlock();
return outputBlock;
return new QgsRasterBlock();
}

QgsRasterBlock *inputBlock = mInput->block( bandNo, extent, width, height );
if ( !inputBlock )
{
return new QgsRasterBlock();
}

// We don't support nuller for color types
if ( QgsRasterBlock::typeIsColor( inputBlock->dataType() ) )
{
return inputBlock;
}

QgsRasterBlock *outputBlock = 0;

if ( mHasOutputNoData.value( bandNo - 1 ) || inputBlock->hasNoDataValue() )

0 comments on commit c0dec5a

Please sign in to comment.
You can’t perform that action at this time.