diff --git a/alg/gdal_interpolateatpoint.cpp b/alg/gdal_interpolateatpoint.cpp index 294516232597..171106f3fb03 100644 --- a/alg/gdal_interpolateatpoint.cpp +++ b/alg/gdal_interpolateatpoint.cpp @@ -377,14 +377,14 @@ bool GDALInterpolateAtPointImpl(GDALRasterBand *pBand, else { const gdal::Vector2i d = inLoc.cast(); - T dfOut{}; - if (!GDALInterpExtractValuesWindow(pBand, cache, d, {1, 1}, &dfOut) || - (bGotNoDataValue && areEqualReal(dfNoDataValue, dfOut))) + T adfOut[1] = {}; + if (!GDALInterpExtractValuesWindow(pBand, cache, d, {1, 1}, adfOut) || + (bGotNoDataValue && areEqualReal(dfNoDataValue, adfOut[0]))) { return FALSE; } - out = dfOut; + out = adfOut[0]; return TRUE; } diff --git a/autotest/cpp/test_gdal_vectorx.cpp b/autotest/cpp/test_gdal_vectorx.cpp index d63547ed06fc..94bb2e6c3514 100644 --- a/autotest/cpp/test_gdal_vectorx.cpp +++ b/autotest/cpp/test_gdal_vectorx.cpp @@ -119,7 +119,7 @@ TEST_F(test_vectorx, array) TEST_F(test_vectorx, fill) { - const auto a = gdal::Vector3d().fill(42.0); + const gdal::Vector3d a = gdal::Vector3d().fill(42.0); EXPECT_EQ(3, a.size()); EXPECT_EQ(42.0, a[0]); EXPECT_EQ(42.0, a[1]); @@ -128,7 +128,7 @@ TEST_F(test_vectorx, fill) TEST_F(test_vectorx, fill_nan) { - const auto a = + const gdal::Vector3d a = gdal::Vector3d().fill(std::numeric_limits::quiet_NaN()); EXPECT_EQ(3, a.size()); EXPECT_TRUE(std::isnan(a[0]));