Skip to content
Permalink
Browse files

don't save invalid wkb

  • Loading branch information
jef-n committed Feb 1, 2016
1 parent 026a5c7 commit 4a8b49b768f91a3d5a9dc697903e37fb3386639b
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/core/geometry/qgsgeometry.cpp
@@ -245,8 +245,17 @@ void QgsGeometry::fromWkb( unsigned char *wkb, int length )
removeWkbGeos();
}
d->geometry = QgsGeometryFactory::geomFromWkb( QgsConstWkbPtr( wkb, length ) );
d->mWkb = wkb;
d->mWkbSize = length;
if ( d->geometry )
{
d->mWkb = wkb;
d->mWkbSize = length;
}
else
{
delete [] wkb;
d->mWkb = nullptr;
d->mWkbSize = 0;
}
}

const unsigned char *QgsGeometry::asWkb() const

0 comments on commit 4a8b49b

Please sign in to comment.
You can’t perform that action at this time.