Skip to content

Commit

Permalink
GDALBandGetBestOverviewLevel2(): add nullptr check
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 17, 2024
1 parent 932fdfb commit 5622f7a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gcore/rasterio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3604,8 +3604,9 @@ int GDALBandGetBestOverviewLevel2(GDALRasterBand *poBand, int &nXOff,
CPLGetConfigOption("GDAL_OVERVIEW_OVERSAMPLING_THRESHOLD", nullptr);
const double dfOversamplingThreshold =
pszOversampligThreshold ? CPLAtof(pszOversampligThreshold)
: psExtraArg->eResampleAlg != GRIORA_NearestNeighbour ? 1.0
: 1.2;
: psExtraArg && psExtraArg->eResampleAlg != GRIORA_NearestNeighbour
? 1.0
: 1.2;
for (int iOverview = 0; iOverview < nOverviewCount; iOverview++)
{
GDALRasterBand *poOverview = poBand->GetOverview(iOverview);
Expand Down

0 comments on commit 5622f7a

Please sign in to comment.