Really fix Ghostscript Coverity issue #3904.

This commit is contained in:
Werner Lemberg 2009-03-21 10:45:18 +01:00
parent 4d1a34ce0b
commit b3e6df69e6
2 changed files with 3 additions and 3 deletions

View File

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

View File

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