[sfnt] Disable bitmap strikes if we don't have a bitmap data table. * src/sfnt/ttsbit.c (tt_face_load_sbit): Check whether we have a bitmap data table.
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 40 41 42 43 44 45 46 47 48 49 50 51
diff --git a/ChangeLog b/ChangeLog
index 183d012..70ffa94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-10-01 Werner Lemberg <wl@gnu.org>
+
+ [sfnt] Disable bitmap strikes if we don't have a bitmap data table.
+
+ * src/sfnt/ttsbit.c (tt_face_load_sbit): Check whether we have
+ a bitmap data table.
+
2016-10-01 Alexei Podtelezhnikov <apodtele@gmail.com>
[smooth] Remove impossibility.
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index 0a90111..b5986aa 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -190,12 +190,14 @@
break;
default:
+ /* we ignore unknown table formats */
error = FT_THROW( Unknown_File_Format );
break;
}
if ( !error )
- FT_TRACE3(( "sbit_num_strikes: %u\n", face->sbit_num_strikes ));
+ FT_TRACE3(( "tt_face_load_sbit_strikes: found %u strikes\n",
+ face->sbit_num_strikes ));
face->ebdt_start = 0;
face->ebdt_size = 0;
@@ -218,6 +220,15 @@
}
}
+ if ( !face->ebdt_size )
+ {
+ FT_TRACE2(( "tt_face_load_sbit_strikes:"
+ " no embedded bitmap data table found;\n"
+ " "
+ " resetting number of strikes to zero\n" ));
+ face->sbit_num_strikes = 0;
+ }
+
return FT_Err_Ok;
Exit: