GRIB driver crashes on specific dataset ( Sample_WindWavesSwell.grb )
gdal_translate -of gtiff Sample_WindWavesSwell.grb out.tif
Causes a crash in GRIBRasterBand::IReadBlock at memcpy:
if (!m_Grib_Data)
{
GRIBDataset *poGDS = (GRIBDataset *) poDS;
FileDataSource grib_fp (poGDS->fp);
ReadGribData(grib_fp, start, subgNum, &m_Grib_Data, &m_Grib_MetaData);
}
// Somehow this decoder guarantees us that the image is upside-down (GRIB scan mode 0100). Therefore reverse it again.
memcpy(pImage, m_Grib_Data + nRasterXSize * (nRasterYSize - nBlockYOff - 1), nRasterXSize * sizeof(double));
duplicate of #3246.