Opened 6 years ago

Closed 6 years ago

#4104 closed defect (fixed)

IReadBlock / IWriteBlock fail to seek

Reported by: lucasvr Owned by: warmerdam
Priority: normal Milestone: 1.8.1
Component: GDAL_Raster Version: unspecified
Severity: major Keywords: IReadBlock IWriteBlock seek
Cc:

Description

The SAGA Raster module may fail to seek to certain file offsets depending on the input file size.

The computation of the offset performed in SAGARasterBand::{IReadBlock,IWriteBlock} on n_mBits, nRasterXSize, nRasterYSize and nBlockYOff results in a signed 32-bit temporary value. As a consequence, if the resulting offset is not within the 32-bit range, a truncated or potentially negative value could be provided to VSIFSeekL(), causing runtime errors such as:

ERROR 3: Unable to seek to beginning of grid row. ERROR 1: IReadBlock failed at X offset 0, Y offset 6684 ERROR 3: Unable to seek to beginning of grid row. ERROR 1: IReadBlock failed at X offset 0, Y offset 6685 ERROR 3: Unable to seek to beginning of grid row. [...]

Attachments (1)

IReadWriteBlock-SeekOffset.patch (2.1 KB) - added by lucasvr 6 years ago.
Proposal fix for the problem, based on GDAL 1.8.0.

Download all attachments as: .zip

Change History (2)

Changed 6 years ago by lucasvr

Proposal fix for the problem, based on GDAL 1.8.0.

comment:1 Changed 6 years ago by Even Rouault

Resolution: fixed
Status: newclosed

Patch applied in trunk (r22478) and in branches/1.8 (r22479). Thanks

Note: See TracTickets for help on using tickets.