Skip to content

Commit

Permalink
Merge pull request #8803 from lucianpls/master
Browse files Browse the repository at this point in the history
MRF: Avoid crashes when no overviews can be generated
  • Loading branch information
rouault authored Nov 24, 2023
2 parents 13e8d6c + 85cd0dc commit ec1d128
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frmts/mrf/marfa_dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ CPLErr MRFDataset::IBuildOverviews(const char *pszResampling, int nOverviews,
// Initialize the empty overlays, all of them for a given scale
// They could already exist, in which case they are not erased
idxSize = AddOverviews(int(scale));

// If we don't have overviews, don't try to generate them
if (GetRasterBand(1)->GetOverviewCount() == 0)
throw CE_None;

if (!CheckFileSize(current.idxfname, idxSize, GA_Update))
{
CPLError(CE_Failure, CPLE_AppDefined,
Expand Down

0 comments on commit ec1d128

Please sign in to comment.