Skip to content
Permalink
Browse files
Fix crash after running GDAL alg from processing (fixes #18004)
This was happening only with GDAL trunk

Processing first tries to load output as a vector, then as a raster
and output from raster algs would crash in OGR provider constructor
due to null pointer
  • Loading branch information
wonder-sk committed Feb 12, 2018
1 parent a7870af commit 6096e5c
Showing 1 changed file with 6 additions and 3 deletions.
@@ -469,9 +469,12 @@ QgsOgrProvider::QgsOgrProvider( QString const &uri )
bool supportsBoolean = false;

#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,3,0)
const char *pszDataTypes = GDALGetMetadataItem( mOgrOrigLayer->driver(), GDAL_DMD_CREATIONFIELDDATASUBTYPES, nullptr );
if ( pszDataTypes && strstr( pszDataTypes, "Boolean" ) )
supportsBoolean = true;
if ( mOgrOrigLayer )
{
const char *pszDataTypes = GDALGetMetadataItem( mOgrOrigLayer->driver(), GDAL_DMD_CREATIONFIELDDATASUBTYPES, nullptr );
if ( pszDataTypes && strstr( pszDataTypes, "Boolean" ) )
supportsBoolean = true;
}
#else
if ( mGDALDriverName == QLatin1String( "GeoJSON" ) ||
mGDALDriverName == QLatin1String( "GML" ) ||

0 comments on commit 6096e5c

Please sign in to comment.