Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spot] name table LANG_TAG_REC_SIZE size definition. #1636

Closed
NSGod opened this issue Apr 12, 2023 · 0 comments · Fixed by #1640
Closed

[spot] name table LANG_TAG_REC_SIZE size definition. #1636

NSGod opened this issue Apr 12, 2023 · 0 comments · Fixed by #1640

Comments

@NSGod
Copy link
Contributor

NSGod commented Apr 12, 2023

In /afdko/c/spot/sfnt_includes/sfnt_name.h, you define LANG_TAG_REC_SIZE for LangTagRecord, but it takes the SIZEOF() from the NameRecord struct instead of the LangTagRecord.

typedef struct
{
    Card16 platformId;
    Card16 scriptId;
    Card16 languageId;
    Card16 nameId;
    Card16 length;
    Card16 offset;
} NameRecord;
#define NAME_REC_SIZE (SIZEOF(NameRecord, platformId) + \
                       SIZEOF(NameRecord, scriptId) +   \
                       SIZEOF(NameRecord, languageId) + \
                       SIZEOF(NameRecord, nameId) +     \
                       SIZEOF(NameRecord, length) +     \
                       SIZEOF(NameRecord, offset))

typedef struct
{
    Card16 length;
    Card16 offset;
} LangTagRecord;
#define LANG_TAG_REC_SIZE (SIZEOF(NameRecord, length) + \
                           SIZEOF(NameRecord, offset))
                                      ^_ should be LangTagRecord

Note that this bug doesn't actually have any effect because the length and offset fields of those structs both happen to have the same size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant