Opened 15 years ago
Closed 15 years ago
#2751 closed defect (fixed)
GRIB driver asserts (crashes) on opening this dataset
Reported by: | gaopeng | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.1 |
Component: | GDAL_Raster | Version: | 1.6.0 |
Severity: | normal | Keywords: | grib |
Cc: | rprinceley |
Description (last modified by )
GRIB driver asserts (crashes) on opening this dataset. The "nSectSize" is a large number, and the memory allocation fails.
memcpy( &nSectSize, abyHead, 4 ); CPL_MSBPTR32( &nSectSize ); if( VSIFSeekL( poDS->fp, nSectSize-5, SEEK_CUR ) != 0 || VSIFReadL( abyHead, 5, 1, poDS->fp ) != 1 ) break;
Attachments (1)
Change History (6)
by , 15 years ago
Attachment: | Sample_QuikSCAT.grb added |
---|
comment:1 by , 15 years ago
Cc: | added |
---|
comment:2 by , 15 years ago
Component: | default → GDAL_Raster |
---|---|
Keywords: | grib added |
Status: | new → assigned |
The file works fine on my 64bit workstation but does fail with an error in CPLMalloc() allocated 1.9GB on a 32bit windows build.
Digging further.
comment:3 by , 15 years ago
Description: | modified (diff) |
---|
comment:4 by , 15 years ago
The problem turns out to be that the PDS scanning logic in gribdataset.cpp assumed that the file was GRIB2, but GRIB1 files use a different byte ordering for section sizes. The correction is to only scan for PDS templates with GRIB 2 files. Applied in trunk (r16455) and 1.6 branch (r16456).
I have also added a minimal test with this sample file in the autotest suite (r16457).
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Adding myself to CC.