Ticket #1573 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

ERROR 2: CPLCalloc(): Out of memory allocating when importing EHdr/ESRI .hdr Labelled raster

Reported by: epatton Owned by: warmerdam
Priority: normal Milestone: 1.4.2
Component: GDAL_Raster Version: 1.4.0
Severity: normal Keywords: ehdr
Cc:

Description (last modified by warmerdam) (diff)

I'm trying to import an ESRI flt raster into Grass 6.3.cvs using r.in.gdal. Using fresh gdal 1.4.1 from today, and fresh Grass 6.3 cvs update from today on Ubuntu 7.04 Beta.

$ gdalinfo -mm 45_18_N_66_06_W_BACKSCATTER.flt

Driver: EHdr/ESRI .hdr Labelled
Size is 2641, 3721
Coordinate System is `'
Origin = (2531369.500000000000000,7366720.500000000000000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Corner Coordinates:
Upper Left  ( 2531369.500, 7366720.500) 
Lower Left  ( 2531369.500, 7362999.500) 
Upper Right ( 2534010.500, 7366720.500) 
Lower Right ( 2534010.500, 7362999.500) 
Center      ( 2532690.000, 7364860.000) 
Band 1 Block=2641x1 Type=Byte, ColorInterp=Undefined
ERROR 2: CPLCalloc(): Out of memory allocating -329 bytes.

  Aborted (core dumped)

~ Eric.

Attachments

45_18_N_66_06_W_BACKSCATTER.hdr Download (126 bytes) - added by epatton 5 years ago.
Header file from the ESRI floating point raster that caused the error

Change History

Changed 5 years ago by epatton

Header file from the ESRI floating point raster that caused the error

Changed 5 years ago by warmerdam

  • status changed from new to closed
  • description modified (diff)
  • component changed from default to GDAL_Raster
  • version changed from unspecified to 1.4.0
  • milestone set to 1.4.2
  • keywords ehdr added
  • resolution set to fixed

The problem is related to initialization when the NBITS keyword is missing from the .hdr file. In 1.4.0 a bunch of new code was introduced for NBITS < 8, but it also added a dependency on having the keyword present.

The workaround is to add "NBITS 8" in the .hdr file.

Fix is to default to 8 in the code. The fix has been committed in trunk, and 1.4 branch and it should be released in 1.4.2.

Note: See TracTickets for help on using tickets.