[mapserver-commits] r7789 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Jul 7 16:03:53 EDT 2008


Author: dmorissette
Date: 2008-07-07 16:03:52 -0400 (Mon, 07 Jul 2008)
New Revision: 7789

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapshape.c
Log:
Avoid fatal error when creating new ShapeFileObj with MapScript (#2674)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-07-07 19:55:02 UTC (rev 7788)
+++ trunk/mapserver/HISTORY.TXT	2008-07-07 20:03:52 UTC (rev 7789)
@@ -13,6 +13,8 @@
 Current Version (SVN Trunk):
 ----------------------------
 
+- Avoid fatal error when creating new ShapeFileObj with MapScript (#2674)
+
 - Fixed problem with WMS INIMAGE exceptions vs AGG output formats (#2438)
 
 - mapshape.c: Fixed integer pointer math being applied to uchars (#2667)

Modified: trunk/mapserver/mapshape.c
===================================================================
--- trunk/mapserver/mapshape.c	2008-07-07 19:55:02 UTC (rev 7788)
+++ trunk/mapserver/mapshape.c	2008-07-07 20:03:52 UTC (rev 7789)
@@ -292,7 +292,8 @@
   }
 
   psSHP->nRecords = pabyBuf[27] + pabyBuf[26] * 256 + pabyBuf[25] * 256 * 256 + pabyBuf[24] * 256 * 256 * 256;
-  psSHP->nRecords = (psSHP->nRecords*2 - 100) / 8;
+  if (psSHP->nRecords != 0)
+      psSHP->nRecords = (psSHP->nRecords*2 - 100) / 8;
 
   if( psSHP->nRecords < 0 || psSHP->nRecords > 256000000 )
   {



More information about the mapserver-commits mailing list