[sfnt] Minor. * src/sfnt/ttcolr.c (tt_face_load_colr_layers): s/palette_index/palette_entry_index/ for consistency. Adjust return error code in case of error.
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
diff --git a/ChangeLog b/ChangeLog
index 01565a7..f02a24c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-06-12 Werner Lemberg <wl@gnu.org>
+
+ [sfnt] Minor.
+
+ * src/sfnt/ttcolr.c (tt_face_load_colr_layers):
+ s/palette_index/palette_entry_index/ for consistency.
+ Adjust return error code in case of error.
+
2018-06-11 Alexei Podtelezhnikov <apodtele@gmail.com>
[raster] Clean up.
diff --git a/src/sfnt/ttcolr.c b/src/sfnt/ttcolr.c
index 64e8b25..8e232c3 100644
--- a/src/sfnt/ttcolr.c
+++ b/src/sfnt/ttcolr.c
@@ -400,18 +400,18 @@
for ( layer_idx = 0; layer_idx < glyph_record.num_layers; layer_idx++ )
{
- FT_UShort gid = FT_NEXT_USHORT( layer_record_ptr );
- FT_UShort palette_index = FT_NEXT_USHORT( layer_record_ptr );
+ FT_UShort gid = FT_NEXT_USHORT( layer_record_ptr );
+ FT_UShort palette_entry_index = FT_NEXT_USHORT( layer_record_ptr );
- if ( palette_index != 0xFFFF &&
- palette_index >= face->palette_data.num_palette_entries )
+ if ( palette_entry_index != 0xFFFF &&
+ palette_entry_index >= face->palette_data.num_palette_entries )
{
- error = FT_THROW( Invalid_File_Format );
+ error = FT_THROW( Invalid_Table );
goto Error;
}
- layers[layer_idx].color_index = palette_index;
+ layers[layer_idx].color_index = palette_entry_index;
layers[layer_idx].glyph_index = gid;
}