GDALBuildOverviews fails if .rrd exists
|Reported by:||rblazek||Owned by:||Even Rouault|
If GDALBuildOverviews() is called on a dataset which has already .rrd file, the .rrd file is deleted, overviews are not created but GDALBuildOverviews() returns CE_None. Next call to GDALBuildOverviews() without reopening the dataset causes crash somewhere in GDAL. It seems that poBand in GDALDefaultOverviews::BuildOverviews() is somehow corrupted or even wrong pointer and calling its methods is causing crash.
This was observed in QGIS, but the first part (not creating overviews) can also be reproduced with gdaladdo.