From 4abfe10ab7a64552db242aa240bbcf2f92598604 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 3 Feb 2019 16:07:10 +0100 Subject: init(): repair to_meter=num/denom that was broken in the general case in PROJ 5; repair vto_meter=num/denom that was broken, and avoid division by zero, which fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12869. Credit to OSS Fuzz --- test/gie/4D-API_cs2cs-style.gie | 8 ++++++++ test/gie/more_builtins.gie | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'test') diff --git a/test/gie/4D-API_cs2cs-style.gie b/test/gie/4D-API_cs2cs-style.gie index f66b26ec..215971a0 100644 --- a/test/gie/4D-API_cs2cs-style.gie +++ b/test/gie/4D-API_cs2cs-style.gie @@ -348,6 +348,14 @@ accept 0 0 1000 expect 0 0 1 roundtrip 1 +operation +proj=longlat +a=1 +b=1 +vto_meter=2000/2 +accept 0 0 1000 +expect 0 0 1 +roundtrip 1 + +operation +proj=longlat +a=1 +b=1 +vto_meter=1/0 +expect failure errno unit_factor_less_than_0 + operation +proj=longlat +a=1 +b=1 +vto_meter=1000 +geoc accept 0 0 1000 expect 0 0 1 diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index 44d01385..d1c978a3 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -496,6 +496,14 @@ expect failure errno unit_factor_less_than_0 operation proj=utm ellps=GRS80 zone=32 to_meter=10 accept 12 55 expect 69187.5632 609890.7825 + +operation proj=utm ellps=GRS80 zone=32 to_meter=1/0 +expect failure errno unit_factor_less_than_0 + +operation proj=utm ellps=GRS80 zone=32 to_meter=2.0/0.2 +accept 12 55 +expect 69187.5632 609890.7825 + ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- cgit v1.2.3