#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 |
Cc: |
Description
The attached sample image has 12 bands. The driver crashes on reading band 4.
Attachments (1)
Change History (4)
by , 14 years ago
Attachment: | Sample_WindWavesSwell.grb added |
---|
comment:1 by , 14 years ago
Keywords: | grib added |
---|---|
Milestone: | 1.5.5 |
Status: | new → assigned |
comment:2 by , 14 years ago
Milestone: | → 1.6.4 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
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).
Reproduced the problem with trunk. Digging...