Ticket #1659 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Fix in 8211

Reported by: caribou Assigned to: warmerdam
Priority: normal Milestone: 1.4.2
Component: default Version: 1.4.1
Severity: normal Keywords:
Cc:

Description

There's a bug in gdal/frmts/iso8211/ddfrecord.cpp probably due to changes. Somebody forgot to take out a ftell and fseek. I would replace :

486 long pos = ftell(fp) - rewindSize;

487 fseek(fp, pos, SEEK_SET);

by:

VSIFSeekL(fp, -rewindSize, SEEK_CUR);

http://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/iso8211/ddfrecord.cpp#L486

Change History

06/04/07 14:57:55 changed by warmerdam

  • status changed from new to closed.
  • version changed from svn-trunk to 1.4.1.
  • resolution set to fixed.
  • milestone set to 1.4.2.

Excellent point. I have patched it like this. For unfortunate reasons the vsi_l_offset type is normally unsigned so we can't actually use VSIFSeekL() properly to seek backwards using SEEK_CUR.

486,487c488,489
<         long pos = ftell(fp) - rewindSize;
<         fseek(fp, pos, SEEK_SET);
---
>         vsi_l_offset pos = VSIFTellL(fp) - rewindSize;
>         VSIFSeekL(fp, pos, SEEK_SET);

Change applied in 1.4.x and trunk.