-
Notifications
You must be signed in to change notification settings - Fork 211
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
Check that the gain map max is >= gain map min. #2580
base: main
Are you sure you want to change the base?
Conversation
Maryla: I am really sorry. I remember I reviewed this pull request but somehow got distracted and forgot to come back. I will review it tomorrow. |
No worries, I completely forgot about this PR as well... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
@@ -49,12 +49,12 @@ void EncodeDecodeValid(ImagePtr image, EncoderPtr encoder, DecoderPtr decoder) { | |||
const avifResult encoder_result = | |||
avifEncoderWrite(encoder.get(), image.get(), &encoded_data); | |||
ASSERT_EQ(encoder_result, AVIF_RESULT_OK) | |||
<< avifResultToString(encoder_result); | |||
<< avifResultToString(encoder_result) << " " << encoder->diag.error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: change " "
to ": "
so that the output looks like ERROR_CODE: error message
.
Also in line 57.
@@ -167,13 +168,31 @@ inline auto ArbitraryAvifAnim() { | |||
return fuzztest::OneOf(ArbitraryAvifAnim8b(), ArbitraryAvifAnim16b()); | |||
} | |||
|
|||
// TODO: Try StructOf<Metadata>(StructOf<uint32_t[3]>())? | |||
// Generates two signed fractions where the first one is smaller than the second | |||
// one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the first one is smaller than or equal to the second one, right?
[max_n, max_d](int32_t min_n) { | ||
// For simplicity, use the same denominator for both fractions. | ||
// This does not cover all possible fractions but makes it easy | ||
// to gurantee that the fraction is smaller. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: gurantee => guarantee
Add "first" before "fraction".
max_n)); | ||
}, | ||
fuzztest::Arbitrary<int32_t>(), | ||
fuzztest::InRange<uint32_t>(1, std::numeric_limits<uint32_t>::max())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: Use fuzztest::NonZero<uint32_t>()
instead?
If this change is correct, make the same change to the other instances below. Or you can make these change in a separate pull request.
Fixes #2573