[woff2] Fix compiler warnings. * src/sfnt/sfwoff2.c (read_num_hmetrics): Remove unused argument `table_len'. Update caller. (triplet_decode, compute_bbox, store_loca, reconstruct_glyf): Make `i' variable unsigned. (reconstruct_glyph): Remove condition which is always false. (reconstruct_html): Removed unused argument `transformed_size'. Update caller. * src/sfnt/woff2tags.c (woff2_known_tags): Remove condition which is always false.
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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
diff --git a/ChangeLog b/ChangeLog
index 91dc356..7a06ca0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2019-08-27 Werner Lemberg <wl@gnu.org>
+
+ [woff2] Fix compiler warnings.
+
+ * src/sfnt/sfwoff2.c (read_num_hmetrics): Remove unused argument
+ `table_len'.
+ Update caller.
+ (triplet_decode, compute_bbox, store_loca, reconstruct_glyf): Make
+ `i' variable unsigned.
+ (reconstruct_glyph): Remove condition which is always false.
+ (reconstruct_html): Removed unused argument `transformed_size'.
+ Update caller.
+
+ * src/sfnt/woff2tags.c (woff2_known_tags): Remove condition which is
+ always false.
+
2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com>
[woff2] Check whether known tag is in array bounds.
diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index fc4094d..6ee6887 100644
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -366,7 +366,6 @@
/* Read `numberOfHMetrics' field from `hhea' table. */
static FT_Error
read_num_hmetrics( FT_Stream stream,
- FT_ULong table_len,
FT_UShort* num_hmetrics )
{
FT_Error error = FT_Err_Ok;
@@ -433,7 +432,7 @@
FT_ULong triplet_index = 0;
FT_ULong data_bytes;
- FT_Int i;
+ FT_UInt i;
if ( n_points > in_size )
@@ -673,7 +672,8 @@
FT_Int y_min = 0;
FT_Int x_max = 0;
FT_Int y_max = 0;
- FT_Int i;
+
+ FT_UInt i;
FT_ULong offset;
FT_Byte* pointer;
@@ -778,7 +778,7 @@
FT_Byte* loca_buf = NULL;
FT_Byte* dst = NULL;
- FT_Int i = 0;
+ FT_UInt i = 0;
FT_ULong loca_buf_size;
const FT_ULong offset_size = index_format ? 4 : 2;
@@ -849,7 +849,7 @@
FT_UShort index_format;
FT_ULong expected_loca_length;
FT_UInt offset;
- FT_Int i;
+ FT_UInt i;
FT_ULong points_size;
FT_ULong bitmap_length;
FT_ULong glyph_buf_size;
@@ -1099,8 +1099,7 @@
substreams[GLYPH_STREAM].offset = FT_STREAM_POS();
- if ( total_n_points >= ( 1 << 27 ) ||
- instruction_size >= ( 1 << 30 ) )
+ if ( total_n_points >= ( 1 << 27 ) )
goto Fail;
size_needed = 12 +
@@ -1333,7 +1332,6 @@
static FT_Error
reconstruct_hmtx( FT_Stream stream,
- FT_ULong transformed_size,
FT_UShort num_glyphs,
FT_UShort num_hmetrics,
FT_Short* x_mins,
@@ -1564,7 +1562,7 @@
/* Get stream size for fields of `hmtx' table. */
if ( table.Tag == TTAG_hhea )
{
- if ( read_num_hmetrics( stream, table.src_length, &num_hmetrics ) )
+ if ( read_num_hmetrics( stream, &num_hmetrics ) )
return FT_THROW( Invalid_Table );
}
@@ -1633,7 +1631,6 @@
table.dst_offset = dest_offset;
if ( reconstruct_hmtx( stream,
- table.src_length,
info->num_glyphs,
info->num_hmetrics,
info->x_mins,
diff --git a/src/sfnt/woff2tags.c b/src/sfnt/woff2tags.c
index 47b1186..4c0feb9 100644
--- a/src/sfnt/woff2tags.c
+++ b/src/sfnt/woff2tags.c
@@ -101,7 +101,7 @@
};
- if ( index < 0 || index > 62 )
+ if ( index > 62 )
return 0;
return known_tags[index];