Navigation Menu

Skip to content

Commit

Permalink
QgsWcsProvider::sourceDataType() and dataType(): avoid out-of-bounds …
Browse files Browse the repository at this point in the history
…read if bandNo == 0
  • Loading branch information
rouault committed May 29, 2020
1 parent e230e77 commit 410b527
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/wcs/qgswcsprovider.cpp
Expand Up @@ -882,7 +882,7 @@ bool QgsWcsProvider::readBlock( int bandNo, int xBlock, int yBlock, void *block
// This could be shared with GDAL provider
Qgis::DataType QgsWcsProvider::sourceDataType( int bandNo ) const
{
if ( bandNo < 0 || bandNo > mSrcGdalDataType.size() )
if ( bandNo <= 0 || bandNo > mSrcGdalDataType.size() )
{
return Qgis::UnknownDataType;
}
Expand All @@ -892,7 +892,7 @@ Qgis::DataType QgsWcsProvider::sourceDataType( int bandNo ) const

Qgis::DataType QgsWcsProvider::dataType( int bandNo ) const
{
if ( bandNo < 0 || bandNo > mGdalDataType.size() )
if ( bandNo <= 0 || bandNo > mGdalDataType.size() )
{
return Qgis::UnknownDataType;
}
Expand Down

0 comments on commit 410b527

Please sign in to comment.