Commit 7f2e4f4f553f6836be7683f66226afac3fa979b8

Werner Lemberg 2012-12-15T09:39:41

[bdf] Fix Savannah bug #37907. * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Normalize negative second parameter of `ENCODING' field also.

diff --git a/ChangeLog b/ChangeLog
index 2cf618d..0887754 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,17 +1,24 @@
 2012-12-15  Werner Lemberg  <wl@gnu.org>
 
+	[bdf] Fix Savannah bug #37907.
+
+	* src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Normalize
+	negative second parameter of `ENCODING' field also.
+
+2012-12-15  Werner Lemberg  <wl@gnu.org>
+
 	[bdf] Fix Savannah bug #37906.
 
-	* src/bdf/bdflib.c (_bdf_parse_glyphs): Use correct array size for
-	checking `glyph_enc'.
+	* src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Use correct array
+	size for checking `glyph_enc'.
 
 2012-12-15  Werner Lemberg  <wl@gnu.org>
 
 	[bdf] Fix Savannah bug #37905.
 
-	* src/bdf/bdflib.c (_bdf_parse_start): Reset `props_size' to zero in
-	case of allocation error; this value gets used in a loop in
-	`bdf_free_font'.
+	* src/bdf/bdflib.c (_bdf_parse_start) <STARTPROPERTIES>: Reset
+	`props_size' to zero in case of allocation error; this value gets
+	used in a loop in `bdf_free_font'.
 
 2012-12-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index f9c06ca..365e671 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -1624,6 +1624,9 @@
       if ( p->glyph_enc == -1 && p->list.used > 2 )
         p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
 
+      if ( p->glyph_enc < -1 )
+        p->glyph_enc = -1;
+
       FT_TRACE4(( DBGMSG2, p->glyph_enc ));
 
       /* Check that the encoding is in the Unicode range because  */