[ftfuzzer] Minor improvements. * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Ignore invalid strikes. Use better values for call to `FT_Set_Char_Size'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/ChangeLog b/ChangeLog
index a1bcfb0..6beb471 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2016-09-09 Werner Lemberg <wl@gnu.org>
+ [ftfuzzer] Minor improvements.
+
+ * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Ignore
+ invalid strikes.
+ Use better values for call to `FT_Set_Char_Size'.
+
+2016-09-09 Werner Lemberg <wl@gnu.org>
+
[sfnt] Don't provide (completely) broken strike data.
FreeType tries to sanitize strike header data; we now reject
diff --git a/src/tools/ftfuzzer/ftfuzzer.cc b/src/tools/ftfuzzer/ftfuzzer.cc
index 39f2b39..c2c48b9 100644
--- a/src/tools/ftfuzzer/ftfuzzer.cc
+++ b/src/tools/ftfuzzer/ftfuzzer.cc
@@ -257,12 +257,14 @@
if ( !fixed_sizes_index )
{
// set up 20pt at 72dpi as an arbitrary size
- FT_Set_Char_Size( face, 20, 20, 72, 72 );
+ if ( FT_Set_Char_Size( face, 20 * 64, 20 * 64, 72, 72 ) );
+ continue;
flags |= FT_LOAD_NO_BITMAP;
}
else
{
- FT_Select_Size( face, fixed_sizes_index - 1 );
+ if ( FT_Select_Size( face, fixed_sizes_index - 1 ) )
+ continue;
flags |= FT_LOAD_COLOR;
}