#1109 closed defect (fixed)
Building overviews on an Imagine-created HFA file results in a segfault
Reported by: | hobu | Owned by: | warmerdam |
---|---|---|---|
Priority: | high | Milestone: | 1.4.3 |
Component: | GDAL_Raster | Version: | unspecified |
Severity: | normal | Keywords: | hfa |
Cc: | daniel112b@… |
Description (last modified by )
#0 0x00279448 in HFAEntry::MarkDirty () from /usr/local/lib/libgdal.so.1 #1 0x00279694 in HFAEntry::HFAEntry () from /usr/local/lib/libgdal.so.1 #2 0x0027c9be in HFACreateLayer () from /usr/local/lib/libgdal.so.1 #3 0x0027334a in HFABand::CreateOverview () from /usr/local/lib/libgdal.so.1 #4 0x0027cfb7 in HFACreateOverview () from /usr/local/lib/libgdal.so.1 #5 0x00278853 in HFARasterBand::BuildOverviews () from /usr/local/lib/libgdal.so.1 #6 0x00274b13 in HFADataset::IBuildOverviews () from /usr/local/lib/libgdal.so.1 #7 0x0034b465 in GDALDataset::BuildOverviews () from /usr/local/lib/libgdal.so.1
You can grab a 70mb copy of the file here: http://www.tcwd.org/flipfree10_5.img.gz
gdaladdo -r average flipfree10_5.img 2 4 8 16
If I use gdal_translate to turn it into an HFA file using GDAL, things work as expected.
Attachments (1)
Change History (8)
comment:2 by , 18 years ago
For the SANZ case (adding alot overviews to a GDAL generated file) it is sufficient to increase the size the RRDNamesList is created with. Change: poRRDNamesList->MakeData( 23+16+8+ 500 /* hack for growth room*/ ); To: poRRDNamesList->MakeData( 23+16+8+ 3000 /* hack for growth room*/ ); The proper solution is for the logic that sets the string field to know how to grow things. That might/should also correct the problem with files not generated by GDAL.
comment:3 by , 17 years ago
I have made a hack for this issue. It's kind of uglu but it seems to work.
What i did was that if the call to SetFieldValue in HFAEntry::SetStringField failes and the name of the entry is "RRDNamesList" i enlarge the entry and try again. In order for this to work i had to do some more minor changes like setting nFilePos to 0 in MakeData and making sure that all file pointers to the changed entry is updated in SetPosition.
I have not tested this a lot but it seems to work fine. One issue with this is that it wastes the old space in the file but that should not be alot.
comment:4 by , 17 years ago
Cc: | added |
---|
comment:5 by , 17 years ago
Description: | modified (diff) |
---|---|
Keywords: | hfa added |
Milestone: | → 1.4.3 |
This needs to be addressed for GDAL 1.5.0 (if not GDAL 1.4.3).
Setting to 1.4.3 for now and I'll review the proposed patch shortly.
comment:6 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:7 by , 16 years ago
Description: | modified (diff) |
---|