ECC-1290: BUFR: Key spectralWaveDensity decoded incorrectly

This commit is contained in:
Shahram Najm 2021-10-13 17:21:40 +01:00
parent f9cf8d2239
commit d2af1b6580
1 changed files with 2 additions and 2 deletions

View File

@ -767,7 +767,7 @@ static int descriptor_get_min_max(bufr_descriptor* bd, long width, long referenc
{
/* Maximum value is allowed to be the largest number (all bits 1) which means it's MISSING */
unsigned long max1 = (1UL << width) - 1; /* Highest value for number with 'width' bits */
DebugAssert(width > 0 && width < 64);
DebugAssert(width > 0 && width <= 32);
*maxAllowed = (max1 + reference) * factor;
*minAllowed = reference * factor;
@ -1100,7 +1100,7 @@ static double decode_double_value(grib_context* c, unsigned char* data, long* po
dval = GRIB_MISSING_DOUBLE;
}
else {
dval = ((long)lval + modifiedReference) * modifiedFactor;
dval = ((int64_t)lval + modifiedReference) * modifiedFactor;
}
return dval;
}