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

Fix std::min() conflicting types in fuzz_dec_incr #2013

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

y-guyon
Copy link
Collaborator

@y-guyon y-guyon commented Feb 15, 2024

See b/308013905

@y-guyon y-guyon merged commit 4131305 into AOMediaCodec:main Feb 15, 2024
20 checks passed
@y-guyon y-guyon deleted the fix_std_min branch February 15, 2024 14:58
out->size =
std::min(size, data->available_size - static_cast<size_t>(offset));
data->read_size =
std::max(data->read_size, static_cast<size_t>(offset) + out->size);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that it is safe to cast offset to size_t (because of the data->available_size < offset check at line 37) and the static_cast<size_t>(offset) + out->size addition won't overflow (because the sum is at most data->available_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 this pull request may close these issues.

None yet

3 participants