Skip to content

Commit

Permalink
Fixed nBytesAvailable tests inside importFromWkb()
Browse files Browse the repository at this point in the history
in OGRLineString and OGRLinearRing classes.


git-svn-id: https://svn.osgeo.org/gdal/trunk@9988 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
mloskot committed Sep 5, 2006
1 parent 76cbd1f commit 7c745e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions ogr/ogrlinearring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@
******************************************************************************
*
* $Log$
* Revision 1.24 2006/09/05 12:14:28 mloskot
* Fixed nBytesAvailable tests inside importFromWkb()
* in OGRLineString and OGRLinearRing classes.
*
* Revision 1.23 2006/07/15 09:12:44 mloskot
* New fixes related to Bug 1195. Recent fixes had minor bugs. NOTE: OGR autotests are failing so they may need some changes (in progress).
* New fixes related to Bug 1195. Recent fixes had minor bugs.
* NOTE: OGR autotests are failing so they may need some changes (in progress).
*
* Revision 1.22 2006/07/14 20:30:25 mloskot
* Fixed new issue related to Bug 1195. Fixed Bug 313.
Expand Down Expand Up @@ -236,7 +241,7 @@ OGRErr OGRLinearRing::_importFromWkb( OGRwkbByteOrder eByteOrder, int b3D,
CPLDebug( "OGR", "WKB Buffer check:\n\tnNewNumPoints=%d\n\tnBufferMinSize=%u\n\tnBytesAvailable=%d\n",
nNewNumPoints, nBufferMinSize, nBytesAvailable);

if( nBufferMinSize > nBytesAvailable )
if( nBufferMinSize > nBytesAvailable && nBytesAvailable > 0 )
{
CPLError( CE_Failure, CPLE_AppDefined,
"Length of input WKB is too small" );
Expand Down
9 changes: 7 additions & 2 deletions ogr/ogrlinestring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@
******************************************************************************
*
* $Log$
* Revision 1.59 2006/09/05 12:14:28 mloskot
* Fixed nBytesAvailable tests inside importFromWkb()
* in OGRLineString and OGRLinearRing classes.
*
* Revision 1.58 2006/07/15 09:12:44 mloskot
* New fixes related to Bug 1195. Recent fixes had minor bugs. NOTE: OGR autotests are failing so they may need some changes (in progress).
* New fixes related to Bug 1195. Recent fixes had minor bugs.
* NOTE: OGR autotests are failing so they may need some changes (in progress).
*
* Revision 1.57 2006/07/14 20:30:25 mloskot
* Fixed new issue related to Bug 1195. Fixed Bug 313.
Expand Down Expand Up @@ -914,7 +919,7 @@ OGRErr OGRLineString::importFromWkb( unsigned char * pabyData,
CPLDebug( "OGR", "WKB Buffer check:\n\tnNewNumPoints=%d\n\tnBufferMinSize=%u\n\tnBytesAvailable=%d\n",
nNewNumPoints, nBufferMinSize, nBytesAvailable);

if( nBufferMinSize > nBytesAvailable )
if( nBufferMinSize > nBytesAvailable && nBytesAvailable > 0 )
{
CPLError( CE_Failure, CPLE_AppDefined,
"Length of input WKB is too small" );
Expand Down

0 comments on commit 7c745e4

Please sign in to comment.