Changeset 12391

Show
Ignore:
Timestamp:
10/12/07 23:45:14 (1 year ago)
Author:
warmerdam
Message:

fix one problem with looping HFAEntries (#1907)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.4/gdal/frmts/hfa/hfaentry.cpp

    r12304 r12391  
    228228    if( poNext == NULL && nNextPos != 0 ) 
    229229    { 
     230        // Check if we have a loop on the next node in this sibling chain. 
     231        HFAEntry *poPast; 
     232 
     233        for( poPast = this;  
     234             poPast != NULL && poPast->nFilePos != nNextPos;  
     235             poPast = poPast->poPrev ) {} 
     236 
     237        if( poPast != NULL ) 
     238        { 
     239            CPLError( CE_Warning, CPLE_AppDefined, 
     240                      "Corrupt (looping) entry in %s, ignoring some entries after %s.", 
     241                      psHFA->pszFilename,  
     242                      szName ); 
     243            nNextPos = 0; 
     244            return NULL; 
     245        } 
     246              
    230247        poNext = new HFAEntry( psHFA, nNextPos, poParent, this ); 
    231248    }