Commit 7b1c7585d7ab929d9b29932d6697a22149162c13

Alexei Podtelezhnikov 2019-06-26T20:18:00

* src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Fix inequality. Reported by Armin Hasitzka.

diff --git a/ChangeLog b/ChangeLog
index 3ba3024..1f74fdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+	* src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Fix inequality.
+
+	Reported by Armin Hasitzka.
+
 2019-06-16  Werner Lemberg  <wl@gnu.org>
 
 	* src/tools/apinames.c: Formatting, minor edits.
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 97c1746..60eb933 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -106,7 +106,7 @@ THE SOFTWARE.
       FT_ULong  code;
 
 
-      if ( mid > max || mid < min )
+      if ( mid >= max || mid < min )
         mid = ( min + max ) >> 1;
 
       code = encodings[mid].enc;
@@ -152,7 +152,7 @@ THE SOFTWARE.
       FT_ULong  code; /* same as BDF_encoding_el.enc */
 
 
-      if ( mid > max || mid < min )
+      if ( mid >= max || mid < min )
         mid = ( min + max ) >> 1;
 
       code = encodings[mid].enc;