Commit b3e6df69e6d112af739f3ad08cb7cafce32683b2

Werner Lemberg 2009-03-21T10:45:18

Really fix Ghostscript Coverity issue #3904.

diff --git a/ChangeLog b/ChangeLog
index fb6e7ca..ed62412 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,7 +17,7 @@
 	Fix Ghostscript Coverity issue #3904.
 
 	* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
-	zero value of `runcnt'.
+	invalid values of `runcnt'.
 
 2009-03-20  Werner Lemberg  <wl@gnu.org>
 
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index cbd401d..f6a10d9 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -157,7 +157,7 @@
         runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK;
         first  = points[i++] = FT_GET_USHORT();
 
-        if ( !runcnt )
+        if ( runcnt < 1 )
           goto Exit;
 
         /* first point not included in runcount */
@@ -168,7 +168,7 @@
       {
         first = points[i++] = FT_GET_BYTE();
 
-        if ( !runcnt )
+        if ( runcnt < 1 )
           goto Exit;
 
         for ( j = 0; j < runcnt; ++j )