diff options
| author | Po Lu <luangruo@yahoo.com> | 2024-04-04 13:52:52 +0800 |
|---|---|---|
| committer | Po Lu <luangruo@yahoo.com> | 2024-04-04 13:52:52 +0800 |
| commit | daefd6771a4879bb8e71ea67f69522700155df01 (patch) | |
| tree | 17dc4a1fcde79c3e7f568d8abd901f9a50a28751 /src | |
| parent | 42c0603c7aab191c9cc15a7eca1253060ff5b71a (diff) | |
Remove redundant byte-swapping boundary
* src/sfnt.c (sfnt_read_OS_2_table):
* src/sfnt.h (struct sfnt_OS_2_table): Don't redundantly realign
after s_family_class.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sfnt.c | 20 | ||||
| -rw-r--r-- | src/sfnt.h | 2 |
2 files changed, 3 insertions, 19 deletions
diff --git a/src/sfnt.c b/src/sfnt.c index 8598b052044..d909fba7677 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -16650,10 +16650,10 @@ sfnt_read_OS_2_table (int fd, struct sfnt_offset_subtable *subtable) OS_2 = xmalloc (sizeof *OS_2); - /* Read data up to the end of `panose'. */ + /* Read data into the structure. */ - wanted = SFNT_ENDOF (struct sfnt_OS_2_table, panose, - unsigned char[10]); + wanted = SFNT_ENDOF (struct sfnt_OS_2_table, fs_last_char_index, + uint16_t); rc = read (fd, OS_2, wanted); if (rc == -1 || rc != wanted) @@ -16680,20 +16680,6 @@ sfnt_read_OS_2_table (int fd, struct sfnt_offset_subtable *subtable) sfnt_swap16 (&OS_2->y_strikeout_size); sfnt_swap16 (&OS_2->y_strikeout_position); sfnt_swap16 (&OS_2->s_family_class); - - /* Read fields between ul_unicode_range and fs_last_char_index. */ - wanted = (SFNT_ENDOF (struct sfnt_OS_2_table, fs_last_char_index, - uint16_t) - - offsetof (struct sfnt_OS_2_table, ul_unicode_range)); - rc = read (fd, &OS_2->ul_unicode_range, wanted); - - if (rc == -1 || rc != wanted) - { - xfree (OS_2); - return NULL; - } - - /* Swap the remainder and return the table. */ sfnt_swap32 (&OS_2->ul_unicode_range[0]); sfnt_swap32 (&OS_2->ul_unicode_range[1]); sfnt_swap32 (&OS_2->ul_unicode_range[2]); diff --git a/src/sfnt.h b/src/sfnt.h index 444b1dfe427..ecc3876b394 100644 --- a/src/sfnt.h +++ b/src/sfnt.h @@ -1395,8 +1395,6 @@ struct sfnt_OS_2_table /* Microsoft ``panose'' classification. */ unsigned char panose[10]; - /* Alignment boundary! */ - /* Unicode range specification. */ uint32_t ul_unicode_range[4]; |
