Skip to content

Commit

Permalink
Revert "Fix avif_fuzztest_enc_dec_anim for AVIF_ADD_IMAGE_FLAG_SINGLE (
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud authored Jan 22, 2024
1 parent 7f98367 commit e170c93
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions tests/gtest/avif_fuzztest_enc_dec_anim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,10 @@ void EncodeDecodeAnimation(ImagePtr frame,
int total_duration = 0;

// Encode.
for (size_t i = 0; i < frame_options.size(); ++i) {
const FrameOptions& options = frame_options[i];
for (const FrameOptions& options : frame_options) {
total_duration += options.duration;
const avifResult result = avifEncoderAddImage(
encoder.get(), frame.get(), options.duration, options.flags);
// AVIF_ADD_IMAGE_FLAG_SINGLE can only be used on one image.
if ((frame_options[0].flags & AVIF_ADD_IMAGE_FLAG_SINGLE) && i > 0) {
ASSERT_EQ(result, AVIF_RESULT_ENCODE_COLOR_FAILED)
<< avifResultToString(result) << " " << encoder->diag.error;
return;
}
// AVIF_ADD_IMAGE_FLAG_SINGLE can only be used on the first image.
// It also cannot be set for layered images.
if ((options.flags & AVIF_ADD_IMAGE_FLAG_SINGLE) &&
(i > 0 || encoder->extraLayerCount > 0)) {
ASSERT_EQ(result, AVIF_RESULT_INVALID_ARGUMENT)
<< avifResultToString(result) << " " << encoder->diag.error;
return;
}

ASSERT_EQ(result, AVIF_RESULT_OK)
<< avifResultToString(result) << " " << encoder->diag.error;
}
Expand Down

0 comments on commit e170c93

Please sign in to comment.