Commit 3845489a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfInqTimestep: check that timevalue has a valid value (bug fix)

parent 37401ff1
......@@ -6965,7 +6965,7 @@ int cdfInqTimestep(stream_t * streamptr, int tsID)
else
{
cdf_get_var1_double(fileID, nctimevarid, &index, &timevalue);
if ( timevalue >= NC_FILL_DOUBLE ) timevalue = 0;
if ( timevalue >= NC_FILL_DOUBLE || timevalue < -NC_FILL_DOUBLE ) timevalue = 0;
cdiDecodeTimeval(timevalue, taxis, &taxis->vdate, &taxis->vtime);
}
......@@ -6976,13 +6976,13 @@ int cdfInqTimestep(stream_t * streamptr, int tsID)
size_t start[2], count[2];
start[0] = tsID; count[0] = 1; start[1] = 0; count[1] = 1;
cdf_get_vara_double(fileID, nctimeboundsid, start, count, &timevalue);
if ( timevalue >= NC_FILL_DOUBLE ) timevalue = 0;
if ( timevalue >= NC_FILL_DOUBLE || timevalue < -NC_FILL_DOUBLE ) timevalue = 0;
cdiDecodeTimeval(timevalue, taxis, &taxis->vdate_lb, &taxis->vtime_lb);
start[0] = tsID; count[0] = 1; start[1] = 1; count[1] = 1;
cdf_get_vara_double(fileID, nctimeboundsid, start, count, &timevalue);
if ( timevalue >= NC_FILL_DOUBLE ) timevalue = 0;
if ( timevalue >= NC_FILL_DOUBLE || timevalue < -NC_FILL_DOUBLE ) timevalue = 0;
cdiDecodeTimeval(timevalue, taxis, &taxis->vdate_ub, &taxis->vtime_ub);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment