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

avifincrtest_helpers: Cast 64-bit offset to size_t #1167

Merged

Conversation

wantehchang
Copy link
Collaborator

Cast the 64-bit offset parameter of PartialRead() to a size_t local variable after verifying that the offset is less than or equal to data->full_size (a size_t). From that point on, use the size_t local variable as the offset exclusively. Note that size_t is a 32-bit unsigned integer on 32-bit platforms.

Audit the entire PartialRead() function for integer overflows.

Fix #1165.

Cast the 64-bit offset parameter of PartialRead() to a size_t local
variable after verifying that the offset is less than or equal to
data->full_size (a size_t). From that point on, use the size_t local
variable as the offset exclusively. Note that size_t is a 32-bit
unsigned integer on 32-bit platforms.

Audit the entire PartialRead() function for integer overflows.

Fix AOMediaCodec#1165.
@wantehchang wantehchang merged commit dfb4279 into AOMediaCodec:main Oct 17, 2022
@wantehchang wantehchang deleted the fix-Wshorten-64-to-32-warnings branch October 17, 2022 17:10
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 this pull request may close these issues.

-Werror breaks tests build on 32-bit architectures
3 participants