[geos-commits] [SCM] GEOS branch master updated. 3a9ce5422c929b5adbae3f2a59d391937600c82a

git at osgeo.org git at osgeo.org
Tue Oct 8 06:56:45 PDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  3a9ce5422c929b5adbae3f2a59d391937600c82a (commit)
      from  b54786f9e1a4538c23a5145064fd51570ff7507a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3a9ce5422c929b5adbae3f2a59d391937600c82a
Author: Daniel Baston <dbaston at gmail.com>
Date:   Tue Oct 8 09:56:22 2019 -0400

    Avoid accessing pointer after move
    
    Fixes #994

diff --git a/src/operation/union/OverlapUnion.cpp b/src/operation/union/OverlapUnion.cpp
index 39ab438..8f21660 100644
--- a/src/operation/union/OverlapUnion.cpp
+++ b/src/operation/union/OverlapUnion.cpp
@@ -124,12 +124,12 @@ OverlapUnion::unionFull(const Geometry* geom0, const Geometry* geom1)
 std::unique_ptr<Geometry>
 OverlapUnion::unionBuffer(const Geometry* geom0, const Geometry* geom1)
 {
+    const GeometryFactory* factory = geom0->getFactory();
     std::unique_ptr<Geometry> copy0 = geom0->clone();
     std::unique_ptr<Geometry> copy1 = geom1->clone();
     std::vector<std::unique_ptr<Geometry>> geoms;
     geoms.push_back(std::move(copy0));
     geoms.push_back(std::move(copy1));
-    const GeometryFactory* factory = copy0->getFactory();
     std::unique_ptr<GeometryCollection> gColl(factory->createGeometryCollection(std::move(geoms)));
     return gColl->buffer(0.0);
 }
diff --git a/tests/xmltester/tests/issue/issue-geos-994.xml b/tests/xmltester/tests/issue/issue-geos-994.xml
new file mode 100644
index 0000000..49d2c92
--- /dev/null
+++ b/tests/xmltester/tests/issue/issue-geos-994.xml
@@ -0,0 +1,171 @@
+<run>
+<precisionModel type="FLOATING" />
+<case>
+<desc>
+Unary union test from QGIS test suite
+</desc>
+<a>
+GEOMETRYCOLLECTION (MULTIPOLYGON (((1756184.5450235498137772 5080652.1657676175236702, 1756184.5450235498137772
+    5080614.4680011207237840, 1756123.0812665277626365 5080614.4680011207237840,
+    1756123.0812665277626365 5080430.0767300482839346, 1756061.6175095040816814 5080430.0767300482839346,
+    1756061.6175095040816814 5080491.5404870714992285, 1756000.1537524810992181 5080491.5404870714992285,
+    1756000.1537524810992181 5080653.7726632226258516, 1756184.5450235498137772 5080652.1657676175236702))),
+    MULTIPOLYGON (((1756000.1537524810992181 5080491.5404870714992285,
+    1756061.6175095040816814 5080491.5404870714992285, 1756061.6175095040816814 5080430.0767300482839346,
+    1756000.1537524810992181 5080430.0767300482839346, 1756000.1537524810992181 5080491.5404870714992285))),
+    MULTIPOLYGON (((1756184.5450235498137772 5080307.1492160055786371,
+    1756246.0087805732619017 5080307.1492160055786371, 1756246.0087805732619017 5080245.6854589805006981,
+    1756184.5450235498137772 5080245.6854589805006981, 1756184.5450235498137772 5080307.1492160055786371))),
+    MULTIPOLYGON (((1756491.8638086654245853 5080061.2941879099234939,
+    1756614.7913227111566812 5080061.2941879099234939, 1756614.7913227111566812 5079938.3666738653555512,
+    1756491.8638086654245853 5079938.3666738653555512, 1756491.8638086654245853 5080061.2941879099234939))),
+    MULTIPOLYGON (((1755508.4436962972395122 5079938.3666738653555512,
+    1755569.9074533204548061 5079938.3666738653555512, 1755569.9074533204548061 5079876.9029168421402574,
+    1755508.4436962972395122 5079876.9029168421402574, 1755508.4436962972395122 5079938.3666738653555512))),
+    MULTIPOLYGON (((1755692.8349673661869019 5079938.3666738653555512,
+    1755754.2987243889365345 5079938.3666738653555512, 1755754.2987243889365345 5079876.9029168421402574,
+    1755692.8349673661869019 5079876.9029168421402574, 1755692.8349673661869019 5079938.3666738653555512))),
+    MULTIPOLYGON (((1755569.9074533204548061 5079876.9029168421402574,
+    1755631.3712103427387774 5079876.9029168421402574, 1755631.3712103427387774 5079753.9754027975723147,
+    1755569.9074533204548061 5079753.9754027975723147, 1755569.9074533204548061 5079876.9029168421402574))),
+    MULTIPOLYGON (((1755938.6899954585824162 5080122.7579449350014329,
+    1756123.0812665277626365 5080122.7579449350014329, 1756123.0812665277626365 5079876.9029168421402574,
+    1756061.6175095040816814 5079876.9029168421402574, 1756061.6175095040816814 5079631.0478887520730495,
+    1755815.7624814116861671 5079631.0478887520730495, 1755815.7624814116861671 5079938.3666738653555512,
+    1755877.2262384353671223 5079938.3666738653555512, 1755938.6899954585824162 5079938.3666738653555512,
+    1755938.6899954585824162 5080122.7579449350014329))),
+    MULTIPOLYGON (((1756246.0087805732619017 5079938.3666738653555512,
+    1756307.4725375962443650 5079938.3666738653555512, 1756307.4725375962443650 5079753.9754027975723147,
+    1756368.9362946192268282 5079753.9754027975723147, 1756368.9362946192268282 5079569.5841317288577557,
+    1756307.4725375962443650 5079569.5841317288577557, 1756184.5450235498137772 5079569.5841317288577557,
+    1756184.5450235498137772 5079753.9754027975723147, 1756246.0087805732619017 5079753.9754027975723147,
+    1756246.0087805732619017 5079938.3666738653555512))),
+    MULTIPOLYGON (((1756614.7913227111566812 5079631.0478887520730495,
+    1756676.2550797339063138 5079631.0478887520730495, 1756676.2550797339063138 5079569.5841317288577557,
+    1756614.7913227111566812 5079569.5841317288577557, 1756614.7913227111566812 5079631.0478887520730495))),
+    MULTIPOLYGON (((1756553.3275656879413873 5079569.5841317288577557,
+    1756614.7913227111566812 5079569.5841317288577557, 1756614.7913227111566812 5079446.6566176833584905,
+    1756553.3275656879413873 5079446.6566176833584905, 1756553.3275656879413873 5079569.5841317288577557))),
+    MULTIPOLYGON (((1756676.2550797339063138 5079569.5841317288577557,
+    1756737.7188367566559464 5079569.5841317288577557, 1756737.7188367566559464 5079446.6566176833584905,
+    1756676.2550797339063138 5079446.6566176833584905, 1756676.2550797339063138 5079569.5841317288577557))),
+    MULTIPOLYGON (((1756000.1537524810992181 5079385.1928606573492289,
+    1756061.6175095040816814 5079385.1928606573492289, 1756061.6175095040816814 5079262.2653466118499637,
+    1756000.1537524810992181 5079262.2653466118499637, 1756000.1537524810992181 5079385.1928606573492289))),
+    MULTIPOLYGON (((1756491.8638086654245853 5079262.2653466118499637,
+    1756553.3275656879413873 5079262.2653466118499637, 1756553.3275656879413873 5079200.8015895904973149,
+    1756491.8638086654245853 5079200.8015895904973149, 1756491.8638086654245853 5079262.2653466118499637))),
+    MULTIPOLYGON (((1756000.1537524810992181 5079077.8740755440667272,
+    1756061.6175095040816814 5079077.8740755440667272, 1756061.6175095040816814 5079016.4103185208514333,
+    1756000.1537524810992181 5079016.4103185208514333, 1756000.1537524810992181 5079077.8740755440667272))),
+    MULTIPOLYGON (((1757045.0376218727324158 5078832.0190474493429065,
+    1757106.5013788954820484 5078832.0190474493429065, 1757106.5013788954820484 5078709.0915334057062864,
+    1757045.0376218727324158 5078709.0915334057062864, 1757045.0376218727324158 5078832.0190474493429065))),
+    MULTIPOLYGON (((1756246.0087805732619017 5078832.0190474493429065,
+    1756307.4725375962443650 5078832.0190474493429065, 1756307.4725375962443650 5078709.0915334057062864,
+    1756368.9362946192268282 5078709.0915334057062864, 1756368.9362946192268282 5078697.1378769595175982,
+    1756061.6175095040816814 5078704.4868044294416904, 1756061.6175095040816814 5078709.0915334057062864,
+    1756184.5450235498137772 5078709.0915334057062864, 1756246.0087805732619017 5078709.0915334057062864,
+    1756246.0087805732619017 5078832.0190474493429065))),
+    MULTIPOLYGON (((1755877.2262384353671223 5080654.8439269624650478,
+    1755877.2262384353671223 5080491.5404870714992285, 1756000.1537524810992181 5080491.5404870714992285,
+    1756000.1537524810992181 5080430.0767300482839346, 1756061.6175095040816814 5080430.0767300482839346,
+    1756061.6175095040816814 5080307.1492160055786371, 1756000.1537524810992181 5080307.1492160055786371,
+    1756000.1537524810992181 5080245.6854589805006981, 1756123.0812665277626365 5080245.6854589805006981,
+    1756123.0812665277626365 5080122.7579449350014329, 1756061.6175095040816814 5080122.7579449350014329,
+    1755938.6899954585824162 5080122.7579449350014329, 1755938.6899954585824162 5079938.3666738653555512,
+    1755877.2262384353671223 5079938.3666738653555512, 1755815.7624814116861671 5079938.3666738653555512,
+    1755815.7624814116861671 5079631.0478887520730495, 1756061.6175095040816814 5079631.0478887520730495,
+    1756061.6175095040816814 5079876.9029168421402574, 1756123.0812665277626365 5079876.9029168421402574,
+    1756123.0812665277626365 5080122.7579449350014329, 1756307.4725375962443650 5080122.7579449350014329,
+    1756307.4725375962443650 5080061.2941879099234939, 1756430.4000516426749527 5080061.2941879099234939,
+    1756430.4000516426749527 5079876.9029168421402574, 1756553.3275656879413873 5079876.9029168421402574,
+    1756553.3275656879413873 5079631.0478887520730495, 1756491.8638086654245853 5079631.0478887520730495,
+    1756491.8638086654245853 5079446.6566176833584905, 1756430.4000516426749527 5079446.6566176833584905,
+    1756246.0087805732619017 5079446.6566176833584905, 1756246.0087805732619017 5079200.8015895904973149,
+    1756184.5450235498137772 5079200.8015895904973149, 1756123.0812665277626365 5079200.8015895904973149,
+    1756123.0812665277626365 5079077.8740755440667272, 1756184.5450235498137772 5079077.8740755440667272,
+    1756184.5450235498137772 5079016.4103185208514333, 1756307.4725375962443650 5079016.4103185208514333,
+    1756307.4725375962443650 5078893.4828044744208455, 1756246.0087805732619017 5078893.4828044744208455,
+    1756246.0087805732619017 5078832.0190474493429065, 1756123.0812665277626365 5078832.0190474493429065,
+    1756123.0812665277626365 5078893.4828044744208455, 1756000.1537524810992181 5078893.4828044744208455,
+    1756000.1537524810992181 5078832.0190474493429065, 1755938.6899954585824162 5078832.0190474493429065,
+    1755877.2262384353671223 5078832.0190474493429065, 1755877.2262384353671223 5078709.0915334057062864,
+    1756000.1537524810992181 5078709.0915334057062864, 1756000.1537524810992181 5078705.9565899241715670,
+    1754455.4951298737432808 5078742.8940787250176072, 1754447.7975028993096203 5080667.3008222607895732,
+    1755877.2262384353671223 5080654.8439269624650478),
+    (1756184.5450235498137772 5079753.9754027975723147, 1756184.5450235498137772 5079569.5841317288577557,
+    1756307.4725375962443650 5079569.5841317288577557, 1756368.9362946192268282 5079569.5841317288577557,
+    1756368.9362946192268282 5079753.9754027975723147, 1756307.4725375962443650 5079753.9754027975723147,
+    1756307.4725375962443650 5079938.3666738653555512, 1756246.0087805732619017 5079938.3666738653555512,
+    1756246.0087805732619017 5079753.9754027975723147, 1756184.5450235498137772 5079753.9754027975723147),
+    (1755508.4436962972395122 5079938.3666738653555512, 1755508.4436962972395122 5079876.9029168421402574,
+    1755569.9074533204548061 5079876.9029168421402574, 1755569.9074533204548061 5079753.9754027975723147,
+    1755631.3712103427387774 5079753.9754027975723147, 1755631.3712103427387774 5079876.9029168421402574,
+    1755569.9074533204548061 5079876.9029168421402574, 1755569.9074533204548061 5079938.3666738653555512,
+    1755508.4436962972395122 5079938.3666738653555512), (1756000.1537524810992181 5079385.1928606573492289,
+    1756000.1537524810992181 5079262.2653466118499637, 1756061.6175095040816814 5079262.2653466118499637,
+    1756061.6175095040816814 5079385.1928606573492289, 1756000.1537524810992181 5079385.1928606573492289),
+    (1755692.8349673661869019 5079938.3666738653555512, 1755692.8349673661869019 5079876.9029168421402574,
+    1755754.2987243889365345 5079876.9029168421402574, 1755754.2987243889365345 5079938.3666738653555512,
+    1755692.8349673661869019 5079938.3666738653555512), (1756000.1537524810992181 5079077.8740755440667272,
+    1756000.1537524810992181 5079016.4103185208514333, 1756061.6175095040816814 5079016.4103185208514333,
+    1756061.6175095040816814 5079077.8740755440667272, 1756000.1537524810992181 5079077.8740755440667272))),
+    MULTIPOLYGON (((1756000.1537524810992181 5078705.9565899241715670, 1756000.1537524810992181 5078709.0915334057062864,
+    1755877.2262384353671223 5078709.0915334057062864, 1755877.2262384353671223 5078832.0190474493429065,
+    1755938.6899954585824162 5078832.0190474493429065, 1756000.1537524810992181 5078832.0190474493429065,
+    1756000.1537524810992181 5078893.4828044744208455, 1756123.0812665277626365 5078893.4828044744208455,
+    1756123.0812665277626365 5078832.0190474493429065, 1756246.0087805732619017 5078832.0190474493429065,
+    1756246.0087805732619017 5078709.0915334057062864, 1756184.5450235498137772 5078709.0915334057062864,
+    1756061.6175095040816814 5078709.0915334057062864, 1756061.6175095040816814 5078704.4868044294416904,
+    1756000.1537524810992181 5078705.9565899241715670)), ((1756368.9362946192268282 5078697.1378769595175982,
+    1756368.9362946192268282 5078709.0915334057062864, 1756307.4725375962443650 5078709.0915334057062864,
+    1756307.4725375962443650 5078832.0190474493429065, 1756246.0087805732619017 5078832.0190474493429065,
+    1756246.0087805732619017 5078893.4828044744208455, 1756307.4725375962443650 5078893.4828044744208455,
+    1756307.4725375962443650 5079016.4103185208514333, 1756184.5450235498137772 5079016.4103185208514333,
+    1756184.5450235498137772 5079077.8740755440667272, 1756123.0812665277626365 5079077.8740755440667272,
+    1756123.0812665277626365 5079200.8015895904973149, 1756184.5450235498137772 5079200.8015895904973149,
+    1756246.0087805732619017 5079200.8015895904973149, 1756246.0087805732619017 5079446.6566176833584905,
+    1756430.4000516426749527 5079446.6566176833584905, 1756491.8638086654245853 5079446.6566176833584905,
+    1756491.8638086654245853 5079631.0478887520730495, 1756553.3275656879413873 5079631.0478887520730495,
+    1756553.3275656879413873 5079876.9029168421402574, 1756430.4000516426749527 5079876.9029168421402574,
+    1756430.4000516426749527 5080061.2941879099234939, 1756307.4725375962443650 5080061.2941879099234939,
+    1756307.4725375962443650 5080122.7579449350014329, 1756123.0812665277626365 5080122.7579449350014329,
+    1756123.0812665277626365 5080245.6854589805006981, 1756000.1537524810992181 5080245.6854589805006981,
+    1756000.1537524810992181 5080307.1492160055786371, 1756061.6175095040816814 5080307.1492160055786371,
+    1756061.6175095040816814 5080430.0767300482839346, 1756123.0812665277626365 5080430.0767300482839346,
+    1756123.0812665277626365 5080614.4680011207237840, 1756184.5450235498137772 5080614.4680011207237840,
+    1756184.5450235498137772 5080652.1657676175236702, 1757981.0082840309478343 5080636.5103143639862537,
+    1757996.4035379793494940 5078658.2201820081099868, 1756368.9362946192268282 5078697.1378769595175982),
+    (1756553.3275656879413873 5079569.5841317288577557, 1756553.3275656879413873 5079446.6566176833584905,
+    1756614.7913227111566812 5079446.6566176833584905, 1756614.7913227111566812 5079569.5841317288577557,
+    1756676.2550797339063138 5079569.5841317288577557, 1756676.2550797339063138 5079631.0478887520730495,
+    1756614.7913227111566812 5079631.0478887520730495, 1756614.7913227111566812 5079569.5841317288577557,
+    1756553.3275656879413873 5079569.5841317288577557), (1756676.2550797339063138 5079569.5841317288577557,
+    1756676.2550797339063138 5079446.6566176833584905, 1756737.7188367566559464 5079446.6566176833584905,
+    1756737.7188367566559464 5079569.5841317288577557, 1756676.2550797339063138 5079569.5841317288577557),
+    (1756184.5450235498137772 5080307.1492160055786371, 1756184.5450235498137772 5080245.6854589805006981,
+    1756246.0087805732619017 5080245.6854589805006981, 1756246.0087805732619017 5080307.1492160055786371,
+    1756184.5450235498137772 5080307.1492160055786371), (1756491.8638086654245853 5080061.2941879099234939,
+    1756491.8638086654245853 5079938.3666738653555512, 1756614.7913227111566812 5079938.3666738653555512,
+    1756614.7913227111566812 5080061.2941879099234939, 1756491.8638086654245853 5080061.2941879099234939),
+    (1757045.0376218727324158 5078832.0190474493429065, 1757045.0376218727324158 5078709.0915334057062864,
+    1757106.5013788954820484 5078709.0915334057062864, 1757106.5013788954820484 5078832.0190474493429065,
+    1757045.0376218727324158 5078832.0190474493429065), (1756491.8638086654245853 5079262.2653466118499637,
+    1756491.8638086654245853 5079200.8015895904973149, 1756553.3275656879413873 5079200.8015895904973149,
+    1756553.3275656879413873 5079262.2653466118499637, 1756491.8638086654245853 5079262.2653466118499637)),
+    ((1756000.1537524810992181 5080653.7726632226258516, 1756000.1537524810992181 5080491.5404870714992285,
+    1755877.2262384353671223 5080491.5404870714992285, 1755877.2262384353671223 5080654.8439269624650478,
+    1756000.1537524810992181 5080653.7726632226258516))))</a>
+<test>
+<op name="union" arg1="A">
+    POLYGON ((1756000.153752481 5080653.772663223, 1756184.5450235498 5080652.1657676175,
+    1757981.008284031 5080636.510314364, 1757996.4035379793 5078658.220182008,
+    1756368.9362946192 5078697.1378769595, 1756061.617509504 5078704.486804429,
+    1756000.153752481 5078705.956589924, 1754455.4951298737 5078742.894078725,
+    1754447.7975028993 5080667.300822261, 1755877.2262384354 5080654.843926962,
+    1756000.153752481 5080653.772663223))
+</op>
+</test>
+</case>
+</run>

-----------------------------------------------------------------------

Summary of changes:
 src/operation/union/OverlapUnion.cpp           |   2 +-
 tests/xmltester/tests/issue/issue-geos-994.xml | 171 +++++++++++++++++++++++++
 2 files changed, 172 insertions(+), 1 deletion(-)
 create mode 100644 tests/xmltester/tests/issue/issue-geos-994.xml


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list