From 2be384c5ac96d704c618ac098e3adc97072a0b71 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 20 Feb 2020 08:58:08 +0000 Subject: Fix wrong byte-swapping for NTv2 grids affecting master after RFC4 work (fixes #1938) --- src/grids.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/grids.cpp') diff --git a/src/grids.cpp b/src/grids.cpp index ec447a33..ee5ecf52 100644 --- a/src/grids.cpp +++ b/src/grids.cpp @@ -1899,7 +1899,10 @@ std::unique_ptr NTv2GridSet::open(PJ_CONTEXT *ctx, if (must_swap) { // 6 double values: southLat, northLat, eastLon, westLon, resLat, // resLon - swap_words(header + OFFSET_SOUTH_LAT, sizeof(double), 6); + for (int i = 0; i < 6; i++) { + swap_words(header + OFFSET_SOUTH_LAT + 16 * i, sizeof(double), + 1); + } swap_words(header + OFFSET_GS_COUNT, sizeof(int), 1); } -- cgit v1.2.3