diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2013-03-19 17:16:10 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2013-03-19 17:16:10 +0400 |
commit | 15a7335d77d056e860a9fdc844343c840e310e68 (patch) | |
tree | 7d74d47ba9109a7a33d61a7c3a232a97c016252e /sql/spatial.cc | |
parent | 2cd7cf8fe6fa41fca124c9239468fc22f8df9957 (diff) | |
download | mariadb-git-15a7335d77d056e860a9fdc844343c840e310e68.tar.gz |
MDEV-4296 Assertion `n_linear_rings > 0' fails in Gis_polygon::centroid_xy.
Forgotten DBUG_ASSERT should be replaced with the 'return error'.
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r-- | sql/spatial.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc index 5a4b768140c..afaa67763e8 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -972,13 +972,11 @@ int Gis_polygon::centroid_xy(double *x, double *y) const const char *data= m_data; bool first_loop= 1; - if (no_data(data, 4)) + if (no_data(data, 4) || + (n_linear_rings= uint4korr(data)) == 0) return 1; - n_linear_rings= uint4korr(data); data+= 4; - DBUG_ASSERT(n_linear_rings > 0); - while (n_linear_rings--) { uint32 n_points, org_n_points; |