Commit 3b37bfc4b59597486230ce67e9b75eb7bc0fab7e

Peter Klotz 2016-08-10T22:38:08

* src/smooth/ftgrays.c (gray_hline): Fix uninitialized access.

diff --git a/ChangeLog b/ChangeLog
index e22d79d..d04298f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-10  Peter Klotz  <Peter.Klotz@ith-icoserve.com>
+
+	* src/smooth/ftgrays.c (gray_hline): Fix uninitialized access.
+
 2016-08-10  Werner Lemberg  <wl@gnu.org>
 
 	[sfnt] Use correct type for `italicAngle' field (#48732).
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 48d01cd..f23dbe2 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1365,10 +1365,10 @@ typedef ptrdiff_t  FT_PtrDist;
       /* see whether we can add this span to the current list */
       count = ras.num_gray_spans;
       span  = ras.gray_spans + count - 1;
-      if ( span->coverage == coverage &&
+      if ( count > 0                  &&
+           span->coverage == coverage &&
            span->x + span->len == x   &&
-           ras.span_y == y            &&
-           count > 0                  )
+           ras.span_y == y            )
       {
         span->len = (unsigned short)( span->len + acount );
         return;