1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-4296 Assertion `n_linear_rings > 0' fails in Gis_polygon::centroid_xy.

Forgotten DBUG_ASSERT should be replaced with the 'return error'.
This commit is contained in:
Alexey Botchkov
2013-03-19 17:16:10 +04:00
parent 2cd7cf8fe6
commit 15a7335d77
3 changed files with 13 additions and 4 deletions

View File

@ -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;