[sfnt] Fix `sizeof' thinko. * src/sfnt/ttcolr.c (tt_face_load_colr, tt_face_palette_set): Don't use `sizeof' for computing array limit.
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
diff --git a/ChangeLog b/ChangeLog
index d054628..a873cfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2018-06-12 Werner Lemberg <wl@gnu.org>
+ [sfnt] Fix `sizeof' thinko.
+
+ * src/sfnt/ttcolr.c (tt_face_load_colr, tt_face_palette_set): Don't
+ use `sizeof' for computing array limit.
+
+2018-06-12 Werner Lemberg <wl@gnu.org>
+
Finish CPAL/COLR support (4/4).
* src/sfnt/ttcolr.c (tt_face_find_color): Removed.
diff --git a/src/sfnt/ttcolr.c b/src/sfnt/ttcolr.c
index 5efdc10..fee4840 100644
--- a/src/sfnt/ttcolr.c
+++ b/src/sfnt/ttcolr.c
@@ -227,7 +227,7 @@
p = cpal_table + type_offset;
q = array;
- limit = q + face->palette_data.num_palettes * sizeof ( FT_UShort );
+ limit = q + face->palette_data.num_palettes;
while ( q < limit )
*q++ = FT_NEXT_USHORT( p );
@@ -248,7 +248,7 @@
p = cpal_table + label_offset;
q = array;
- limit = q + face->palette_data.num_palettes * sizeof ( FT_UShort );
+ limit = q + face->palette_data.num_palettes;
while ( q < limit )
*q++ = FT_NEXT_USHORT( p );
@@ -269,8 +269,7 @@
p = cpal_table + entry_label_offset;
q = array;
- limit = q + face->palette_data.num_palette_entries *
- sizeof ( FT_UShort );
+ limit = q + face->palette_data.num_palette_entries;
while ( q < limit )
*q++ = FT_NEXT_USHORT( p );
@@ -459,7 +458,7 @@
p = cpal->colors + COLOR_SIZE * FT_PEEK_USHORT( offset );
q = face->palette;
- limit = q + face->palette_data.num_palette_entries * sizeof ( FT_Color );
+ limit = q + face->palette_data.num_palette_entries;
while ( q < limit )
{