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

crash on 64-bit platforms due to uintptr_t typedef #1

Closed
danadam opened this issue Aug 22, 2022 · 1 comment
Closed

crash on 64-bit platforms due to uintptr_t typedef #1

danadam opened this issue Aug 22, 2022 · 1 comment
Labels
bug Something isn't working complete Performed

Comments

@danadam
Copy link

danadam commented Aug 22, 2022

On most 64-bit platforms a pointer size is 64-bit, while unsigned is 32-bit: https://en.cppreference.com/w/c/language/arithmetic_types#Data_models

The typedef in fa_inttypes.h:

typedef unsigned uintptr_t;

and the usage of this uintptr_t like in aacenc_init() for example:

uintptr_t aacenc_init(...) {
    fa_aacenc_ctx_t *f = (fa_aacenc_ctx_t *)malloc(sizeof(fa_aacenc_ctx_t));
    ...
    return (uintptr_t)f;

will chop off half of the pointer value. When such pointer is dereferenced later, it causes a crash.

@zvezdochiot
Copy link
Member

Hi @danadam .

Yes, don't care.

zvezdochiot added a commit that referenced this issue Aug 22, 2022
@zvezdochiot zvezdochiot added bug Something isn't working complete Performed labels Aug 22, 2022
zvezdochiot added a commit that referenced this issue Aug 22, 2022
zvezdochiot added a commit that referenced this issue Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working complete Performed
Projects
None yet
Development

No branches or pull requests

2 participants