Opened 18 years ago

Last modified 17 years ago

#1331 closed defect

HDF4 EOS case EOS GRID memory error. — at Version 2

Reported by: denis.nadeau@… Owned by: warmerdam
Priority: normal Milestone: 1.4.2
Component: GDAL_Raster Version: unspecified
Severity: major Keywords: hdf
Cc:

Description (last modified by warmerdam)

hdf4imagedataset.cpp line 2221
poDS->iBandDim = i;

When Dimension List does not have the word "Band", this variable never get set and it is initialized to -1 in the constructor.  This cause a memory error in IReadBlock method.

hdf4imagedataset.cpp line 429
aiStart[poGDS->iBandDim] = nBand - 1;
aiEdges[poGDS->iBandDim] = 1;

aiEdges[-1]=1  on my machine cause eERR variable to be set to CPL_DEBUG and causing a faulty GDAL Read error, for eERR should be CPL_None when IReadBlock returns.

I guess in the 3D array case this should be set to 0.

Denis

Change History (2)

comment:1 by denis.nadeau@…, 18 years ago

This condition works for me.  I assume that X and Y dimension will
have X or Y in there name. 

line 2221
                    for ( i = 0; i < nDimCount; i++ )
                    {
                        if ( !(strstr( papszDimList[i], "X" )) &&
			     !(strstr( papszDimList[i], "Y" )) )
                        {

comment:2 by warmerdam, 17 years ago

Description: modified (diff)
Milestone: 1.4.1
Priority: highestnormal
Status: newassigned

Denis,

I ran into this today, and put a bunch of fixes in related to this area of code.

Can you verify that the trunk version of GDAL fixes the problem you were seeing?

Note: See TracTickets for help on using tickets.