summaryrefslogtreecommitdiff
path: root/sql/spatial.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/spatial.cc')
-rw-r--r--sql/spatial.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 6e2e03bf5bb..783d37ada48 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -627,7 +627,8 @@ int Gis_line_string::is_closed(int *closed) const
return 0;
}
data+= 4;
- if (no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points))
+ if (n_points == 0 ||
+ no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points))
return 1;
/* Get first point */