[Gdal-dev] ArcMap overview AUX files

Sheykhet, Rostic rsheykhet at sanz.com
Wed Nov 2 17:25:23 EST 2005


Hi all,

There appears to be a problem with using ArcMap-created .aux files as
overviews.
When I execute the sample test case below, I get an access violation on
Windows and a segfault on unix.
This problem has been verified with the
http://www.gdal.org/dl/data/gtiff/utm.tif file.
I am attaching the .aux file generated for the utm.tif so that this can
be tested without ArcMap.

Steps to reproduce: 
 1. Open the file for viewing in ArcMap (a utm.aux file should
automatically be created) and Close ArcMap.
    Or
 1a. Put the utm.aux file in the same directory with utm.tif
 2. Execute the test case below.
 3. Access violation or segmentation fault should result.

I am using GDAL 1.3.1.

Thanks,

Rostic

================================= Test Case Code
Begin========================================

// Open dataset1 and dataset2 on the same tiff file with the .aux file
present
// Close dataset2 and then close dataset1.  First destructor goes
through fine,
// but an Access Violation somewhere in 
// GDALDefaultOverviews::~GDALDefaultOverviews() (Line 103) results when
the
// second dataset destructor is called.

#include <gdal.h>
#include <gdal_priv.h>
#include <iostream>

using namespace std;

int main(int argc, char** argv) {
   if(argc != 2) {
      cerr << "Usage: " << argv[0] << " <file name to read>" << endl;
      return 1;
   }
   
   GDALAllRegister();

   GDALDataset *hDataset1 = (GDALDataset *)GDALOpen( argv[1],
GA_ReadOnly);


   if(!hDataset1) {
      cerr << "Could not open dataset 1: " << CPLGetLastErrorMsg() <<
endl;
      return 1;
   }


   GDALDataset *hDataset2 = (GDALDataset *)GDALOpen( argv[1],
GA_ReadOnly);
   if(!hDataset2) {
      cerr << "Could not open dataset 2: " << CPLGetLastErrorMsg() <<
endl;
      return 1;
   }
  delete hDataset2; // Also tried GDALClose(), did not make a
difference.
  delete hDataset1; // Also tried GDALClose(), did not make a
difference.
  return 0;
}
================================= Test Case Code
End========================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utm.aux
Type: application/octet-stream
Size: 5056 bytes
Desc: utm.aux
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051102/f3e8813f/utm.obj


More information about the Gdal-dev mailing list