Initialize matrix during name parsing
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 1 Jan 2013 01:55:37 +0000 (19:55 -0600)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 1 Jan 2013 01:56:06 +0000 (19:56 -0600)
Before:
$ fc-match sans:matrix=2 -v | grep matrix
matrix: [2 6.95183e-310; 0 0](s)

After:
$ fc-match sans:matrix=2 -v | grep matrix
matrix: [2 0; 0 1](s)

src/fcname.c

index b7c0217..0cdbd42 100644 (file)
@@ -595,6 +595,7 @@ FcNameConvert (FcType type, FcChar8 *string)
        v.u.d = strtod ((char *) string, 0);
        break;
     case FcTypeMatrix:
+       m.xx = m.yy = 1.; m.xy = m.yx = 0.;
        sscanf ((char *) string, "%lg %lg %lg %lg", &m.xx, &m.xy, &m.yx, &m.yy);
        v.u.m = FcMatrixCopy (&m);
        break;