[gdal-dev] Grib2 Question

Even Rouault even.rouault at spatialys.com
Tue Nov 7 15:58:10 PST 2017

On mardi 7 novembre 2017 17:45:57 CET Roarke Gaskill wrote:
> It seems inappropriate (even as a quick hack) to put the size check in the
> grib parser. 

If we default to knMaxAllloc = INT_MAX, given that *ndpts is g2int, then the check will 
be a no-op. Actually the compiler and/or static analyzers will probably complain about 
that... So INT_MAX - 1 is probably a better choice :-)

> With the check there, you are not able to run simple utilities
> like gdalinfo on large files. What if I wanted to use gdalinfo to find out
> if the file is too big to process?

Unfortunately given how the GRIB degrib and underlying libaries used are done, you 
cannot get metadata without processing the whole file.

Spatialys - Geospatial professional services
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171108/5f93427e/attachment-0001.html>

More information about the gdal-dev mailing list