Commit 03b0cc2ea9b63f57ec58f77d8cc1350691d7140a

Werner Lemberg 2017-06-02T09:16:52

[bdf] Don't left-shift negative numbers. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2031 * src/bdf/bdfdrivr.c (BDF_Face_Init): Use multiplication.

diff --git a/ChangeLog b/ChangeLog
index 6d921ba..6194a2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2017-06-02  Werner Lemberg  <wl@gnu.org>
 
+	[bdf] Don't left-shift negative numbers.
+
+	Reported as
+
+	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2031
+
+	* src/bdf/bdfdrivr.c (BDF_Face_Init): Use multiplication.
+
+2017-06-02  Werner Lemberg  <wl@gnu.org>
+
 	[bdf] Fix integer scanning routines.
 
 	Reported as
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index c0a5a5c..540d367 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -455,11 +455,11 @@ THE SOFTWARE.
           bsize->size =
             (FT_Pos)( ( prop->value.l * 64 * 7200 + 36135L ) / 72270L );
         else
-          bsize->size = bsize->width << 6;
+          bsize->size = bsize->width * 64;
 
         prop = bdf_get_font_property( font, "PIXEL_SIZE" );
         if ( prop )
-          bsize->y_ppem = (FT_Short)prop->value.l << 6;
+          bsize->y_ppem = (FT_Short)prop->value.l * 64;
 
         prop = bdf_get_font_property( font, "RESOLUTION_X" );
         if ( prop )