Package: release.debian.org Severity: normal Tags: stretch User: release.debian....@packages.debian.org Usertags: pu
Upstream has releases a new stable release of libosmium fixing important bugs which I'd like to propose for inclusion in the next stable update. Kind Regards, Bas
diff -Nru libosmium-2.11.3/CHANGELOG.md libosmium-2.11.4/CHANGELOG.md --- libosmium-2.11.3/CHANGELOG.md 2017-05-03 14:01:48.000000000 +0200 +++ libosmium-2.11.4/CHANGELOG.md 2017-08-15 15:41:10.000000000 +0200 @@ -8,6 +8,14 @@ ### Fixed +## [2.11.4] - 2017-08-15 + +### Fixed + +- Output coordinate with value of -2^31 correctly. +- Buffers larger than 2^32 bytes do now work. + + ## [2.11.3] - 2017-05-03 ### Fixed diff -Nru libosmium-2.11.3/CMakeLists.txt libosmium-2.11.4/CMakeLists.txt --- libosmium-2.11.3/CMakeLists.txt 2017-05-03 14:01:48.000000000 +0200 +++ libosmium-2.11.4/CMakeLists.txt 2017-08-15 15:41:10.000000000 +0200 @@ -25,7 +25,7 @@ set(LIBOSMIUM_VERSION_MAJOR 2) set(LIBOSMIUM_VERSION_MINOR 11) -set(LIBOSMIUM_VERSION_PATCH 3) +set(LIBOSMIUM_VERSION_PATCH 4) set(LIBOSMIUM_VERSION "${LIBOSMIUM_VERSION_MAJOR}.${LIBOSMIUM_VERSION_MINOR}.${LIBOSMIUM_VERSION_PATCH}") diff -Nru libosmium-2.11.3/debian/changelog libosmium-2.11.4/debian/changelog --- libosmium-2.11.3/debian/changelog 2017-05-03 18:44:44.000000000 +0200 +++ libosmium-2.11.4/debian/changelog 2017-08-26 15:05:22.000000000 +0200 @@ -1,3 +1,12 @@ +libosmium (2.11.4-1) stretch; urgency=medium + + * New upstream bugfix release. + - Output coordinate with value of -2^31 correctly. + - Buffers larger than 2^32 bytes do now work. + * Update branch in gbp.conf & Vcs-Git URL. + + -- Bas Couwenberg <sebas...@debian.org> Sat, 26 Aug 2017 15:05:22 +0200 + libosmium (2.11.3-1) unstable; urgency=medium * New upstream bugfix release. diff -Nru libosmium-2.11.3/debian/control libosmium-2.11.4/debian/control --- libosmium-2.11.3/debian/control 2017-05-03 18:37:13.000000000 +0200 +++ libosmium-2.11.4/debian/control 2017-08-26 15:03:43.000000000 +0200 @@ -19,7 +19,7 @@ zlib1g-dev Standards-Version: 3.9.8 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-grass/libosmium.git/ -Vcs-Git: https://anonscm.debian.org/git/pkg-grass/libosmium.git +Vcs-Git: https://anonscm.debian.org/git/pkg-grass/libosmium.git -b stretch Homepage: http://osmcode.org/libosmium/ Package: libosmium2-dev diff -Nru libosmium-2.11.3/debian/gbp.conf libosmium-2.11.4/debian/gbp.conf --- libosmium-2.11.3/debian/gbp.conf 2017-05-03 18:37:13.000000000 +0200 +++ libosmium-2.11.4/debian/gbp.conf 2017-08-26 15:03:36.000000000 +0200 @@ -6,7 +6,7 @@ # The default name for the Debian branch is "master". # Change it if the name is different (for instance, "debian/unstable"). -debian-branch = master +debian-branch = stretch # git-import-orig uses the following names for the upstream tags. # Change the value if you are not using git-import-orig diff -Nru libosmium-2.11.3/include/osmium/memory/item.hpp libosmium-2.11.4/include/osmium/memory/item.hpp --- libosmium-2.11.3/include/osmium/memory/item.hpp 2017-05-03 14:01:48.000000000 +0200 +++ libosmium-2.11.4/include/osmium/memory/item.hpp 2017-08-15 15:41:10.000000000 +0200 @@ -62,7 +62,8 @@ constexpr const item_size_type align_bytes = 8; inline constexpr std::size_t padded_length(std::size_t length) noexcept { - return (length + align_bytes - 1) & ~(align_bytes - 1); + return (length + static_cast<std::size_t>(align_bytes) - 1) & + ~(static_cast<std::size_t>(align_bytes) - 1); } /** diff -Nru libosmium-2.11.3/include/osmium/osm/location.hpp libosmium-2.11.4/include/osmium/osm/location.hpp --- libosmium-2.11.3/include/osmium/osm/location.hpp 2017-05-03 14:01:48.000000000 +0200 +++ libosmium-2.11.4/include/osmium/osm/location.hpp 2017-08-15 15:41:10.000000000 +0200 @@ -33,6 +33,7 @@ */ +#include <algorithm> #include <cmath> #include <cstdint> #include <cstring> @@ -198,6 +199,12 @@ // Convert integer as used by location for coordinates into a string. template <typename T> inline T append_location_coordinate_to_string(T iterator, int32_t value) { + // need to special-case this, because later `value = -value` would overflow. + if (value == std::numeric_limits<int32_t>::min()) { + static const char minresult[] = "-214.7483648"; + return std::copy_n(minresult, sizeof(minresult) - 1, iterator); + } + // handle negative values if (value < 0) { *iterator++ = '-'; diff -Nru libosmium-2.11.3/include/osmium/version.hpp libosmium-2.11.4/include/osmium/version.hpp --- libosmium-2.11.3/include/osmium/version.hpp 2017-05-03 14:01:48.000000000 +0200 +++ libosmium-2.11.4/include/osmium/version.hpp 2017-08-15 15:41:10.000000000 +0200 @@ -35,8 +35,8 @@ #define LIBOSMIUM_VERSION_MAJOR 2 #define LIBOSMIUM_VERSION_MINOR 11 -#define LIBOSMIUM_VERSION_PATCH 3 +#define LIBOSMIUM_VERSION_PATCH 4 -#define LIBOSMIUM_VERSION_STRING "2.11.3" +#define LIBOSMIUM_VERSION_STRING "2.11.4" #endif // OSMIUM_VERSION_HPP diff -Nru libosmium-2.11.3/test/t/osm/test_location.cpp libosmium-2.11.4/test/t/osm/test_location.cpp --- libosmium-2.11.3/test/t/osm/test_location.cpp 2017-05-03 14:01:48.000000000 +0200 +++ libosmium-2.11.4/test/t/osm/test_location.cpp 2017-08-15 15:41:10.000000000 +0200 @@ -260,6 +260,7 @@ C("179.9999999", 1799999999); C("179.99999999", 1800000000); C("200.123", 2001230000); + C("214.7483647", 2147483647); C("8.109E-4" , 8109); C("8.1090E-4" , 8109); @@ -332,6 +333,12 @@ C("1.1e2:", 1100000000, ":"); } +TEST_CASE("Parsing min coordinate from string") { + const char* minval = "-214.7483648"; + const char** data = &minval; + REQUIRE(osmium::detail::string_to_location_coordinate(data) == -2147483648l); +} + TEST_CASE("Writing zero coordinate into string") { std::string buffer; osmium::detail::append_location_coordinate_to_string(std::back_inserter(buffer), 0); @@ -369,6 +376,15 @@ CW( 40101010, "4.010101"); CW( 494561234, "49.4561234"); CW(1799999999, "179.9999999"); + + CW(2147483647, "214.7483647"); +} + +TEST_CASE("Writing min coordinate into string") { + std::string buffer; + + osmium::detail::append_location_coordinate_to_string(std::back_inserter(buffer), -2147483648l); + REQUIRE(buffer == "-214.7483648"); } TEST_CASE("set lon/lat from string") {