Changeset 14762

Show
Ignore:
Timestamp:
06/24/08 17:39:41 (5 months ago)
Author:
warmerdam
Message:

avoid reducing array sizes if writing them in random order (#2427)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.5/gdal/frmts/hfa/hfafield.cpp

    r13725 r14762  
    408408        } 
    409409 
    410         nOffset = nCount; 
     410        // we will update the object count iff we are writing beyond the end 
     411        memcpy( &nOffset, pabyData, 4 ); 
    411412        HFAStandard( 4, &nOffset ); 
    412         memcpy( pabyData, &nOffset, 4 ); 
     413        if( nOffset < nCount ) 
     414        { 
     415            nOffset = nCount; 
     416            HFAStandard( 4, &nOffset ); 
     417            memcpy( pabyData, &nOffset, 4 ); 
     418        } 
    413419 
    414420        if( pValue == NULL )