-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QgsRasterDataProvider.block() returns invalid QgsRasterBlock if requested block size exceeds a certain threshold #47097
Comments
Also note that GDAL can read raster of such size without a problem:
|
I can confirm this for OSGeo4W QGIS master. During initialization of the QgsRasterBlock the requested size_t = 6500000000 is too large and leads to void *qgsMalloc( size_t size )
{
if ( size == 0 || long( size ) < 0 )
{
QgsDebugMsg( QStringLiteral( "Negative or zero size %1." ).arg( size ) );
return nullptr;
}
void *p = malloc( size );
if ( !p )
{
QgsDebugMsg( QStringLiteral( "Allocation of %1 bytes failed." ).arg( size ) );
}
return p;
} |
nyalldawson
added a commit
to nyalldawson/QGIS
that referenced
this issue
Jan 31, 2022
nyalldawson
added a commit
that referenced
this issue
Feb 1, 2022
qgis-bot
pushed a commit
that referenced
this issue
Feb 1, 2022
nyalldawson
added a commit
that referenced
this issue
Feb 2, 2022
nyalldawson
added a commit
that referenced
this issue
Feb 20, 2022
nyalldawson
added a commit
that referenced
this issue
Feb 21, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the bug or the crash?
For any GDAL raster layer, the QgsRasterDataProvider.block() returns an invalid QgsRasterBlock, if requested block size exceeds a certain threshold.
Steps to reproduce the issue
>>>iface.activeLayer().dataProvider().block(1, iface.mapCanvas().extent(), 65000, 50000).isValid()
False
Note that for slightly smaller block sizes, everything works fine:
>>>iface.activeLayer().dataProvider().block(1, iface.mapCanvas().extent(), 60000, 50000).isValid()
True
Versions
QGIS version
3.22.1-Białowieża
QGIS code revision
663dcf8
Qt version
5.15.2
Python version
3.9.5
GDAL/OGR version
3.4.0
PROJ version
8.2.0
EPSG Registry database version
v10.038 (2021-10-21)
GEOS version
3.10.0-CAPI-1.16.0
SQLite version
3.35.2
PDAL version
2.3.0
PostgreSQL client version
13.0
SpatiaLite version
5.0.1
QWT version
6.1.3
QScintilla2 version
2.11.5
OS version
Windows 10 Version 2009
Active Python plugins
BitFlagRenderer
0.4.20200817T093838.master
changeDataSource
3.1
DataPlotly
3.8.1
ee_plugin
0.0.4
force4qgis
1.0.1
InvisibleLayersAndGroups
2.1
rasterdataplotting
1.6.3
rastertimeseriesmanager
1.8
timeseriesviewerplugin
1.17.20210312T143004.master
zoomview
1.1.1
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.5
processing
2.12.99
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: