Opened 13 years ago

Closed 13 years ago

Last modified 9 years ago

#3246 closed defect (fixed)

GRIB crashes on reading 4th band of this grib image

Reported by: gaopeng Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.6.1
Severity: normal Keywords: grib


The attached sample image has 12 bands. The driver crashes on reading band 4.

Attachments (1)

Sample_WindWavesSwell.grb (22.4 KB ) - added by gaopeng 13 years ago.

Download all attachments as: .zip

Change History (4)

by gaopeng, 13 years ago

Attachment: Sample_WindWavesSwell.grb added

comment:1 by warmerdam, 13 years ago

Keywords: grib added
Milestone: 1.5.5
Status: newassigned

Reproduced the problem with trunk. Digging...

comment:2 by warmerdam, 13 years ago

Milestone: 1.6.4
Resolution: fixed
Status: assignedclosed

It turns out that some of the bands (4-12) have a different raster size than the prototype band (1). The code did not handle this or check for it in any way.

I have modified the code to issue a warning in this case, and in IReadBlock() to do the best it can with the imagery. In this case the later band images are smaller, so they are read in the top left corner of the dataset. If they were bigger part would be clipped.

We can't easily detect this in Open() without actually reading all the band data due to the way the code (and degrib) is structured. Another approach (possibly better) approach would be to treat the bands as subdatasets so they can be independently sized. But this would add a good deal of complication for what appears to be an uncommon case.

The fix is in trunk (r18099) with an autotest test (r18098). Also fixed in 1.6 branch (r18100) and 1.6-esri branch (r18101).

comment:3 by Even Rouault, 9 years ago

Milestone: 1.6.4

Milestone 1.6.4 deleted

Note: See TracTickets for help on using tickets.