Ticket #774 (closed defect: fixed)
Large IMG files (over 6GB) problems
| Reported by: | bolsen@… | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | default | Version: | unspecified |
| Severity: | normal | Keywords: | VERIFIED |
| Cc: |
Description
Tried to cut 1GB geotiff chunks out of an 11GB Erdas img file.
Translate would abort when accessing one of the offset bands.
There's an overflow problem not being properly handled in hfaband.cpp and
hfaopen.cpp.
The short of it is that the img field: "layerStackDataOffset[1]" is used for
64bit file offset. Currently it's being hard set and read with value '0'.
Tried today's build, same problem (cvs 20070217)
I can verify that these suggested fixed are NOT cross platform, in fact they
break on amd64.
Suggested fixes:
hfaband.cpp: HFABand::LoadExternalBlockInfo()
roughly line 480:
/*
nBlockStart = poDMS->GetIntField( "layerStackDataOffset[0]" );
*/
unsigned long low
= (unsigned long)poDMS->GetIntField( "layerStackDataOffset[0]" );
unsigned long high
= (unsigned long)poDMS->GetIntField( "layerStackDataOffset[1]" );
unsigned long* sPtr = (unsigned long*)&nBlockStart;
*sPtr = low;
++sPtr;
*sPtr = high;
hfaopen.cpp: HFACreate
about line 1741
vsi_l_offset blockOffset = (vsi_l_offset)(iHeaderSize)
+ (vsi_l_offset)(nBands) * (vsi_l_offset)(iFlagsSize);
poEdms_State->SetIntField( "layerStackDataOffset[0]" , (int) (blockOffset >>
32) );
poEdms_State->SetIntField( "layerStackDataOffset[1]" , (int) (blockOffset &
0xffffffff) );
/*
poEdms_State->SetIntField( "layerStackDataOffset[0]",
iHeaderSize + nBands * iFlagsSize );
poEdms_State->SetIntField( "layerStackDataOffset[1]", 0 );
*/
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

