Guard Avg16x16IntegerOverflow test w/ HIGHBITDEPTH Guard the EncodeAPI.Avg16x16IntegerOverflow test with CONFIG_AV1_HIGHBITDEPTH because it requires 12-bit support. Use ASSERT_EQ on the aom_codec_enc_init() call because the test should not proceed further if aom_codec_enc_init() fails. Bug: oss-fuzz:572842743 Change-Id: I6e7dd9393cd46dcc3ef33055524fa29b269e322d (cherry picked from commit 4b76512ba1612e624f8944784c0484f10a65e204)
diff --git a/test/encode_api_test.cc b/test/encode_api_test.cc index 4540dde..3e40fc3 100644 --- a/test/encode_api_test.cc +++ b/test/encode_api_test.cc
@@ -2951,6 +2951,7 @@ ASSERT_EQ(aom_codec_destroy(&codec), AOM_CODEC_OK); } +#if CONFIG_AV1_HIGHBITDEPTH // A test that reproduces issues.oss-fuzz.com/issues/572842743: signed integer // overflow in fill_variance_tree_leaves(). TEST(EncodeAPI, Avg16x16IntegerOverflow) { @@ -3077,7 +3078,7 @@ cfg.rc_min_quantizer = 57; cfg.rc_max_quantizer = 63; aom_codec_ctx_t enc; - EXPECT_EQ(AOM_CODEC_OK, + ASSERT_EQ(AOM_CODEC_OK, aom_codec_enc_init(&enc, iface, &cfg, AOM_CODEC_USE_HIGHBITDEPTH)); EXPECT_EQ(AOM_CODEC_OK, aom_codec_control(&enc, AV1E_SET_TILE_ROWS, 5)); EXPECT_EQ(AOM_CODEC_OK, aom_codec_control(&enc, AV1E_SET_TILE_COLUMNS, 2)); @@ -3170,5 +3171,6 @@ EXPECT_EQ(AOM_CODEC_OK, aom_codec_destroy(&enc)); } +#endif // CONFIG_AV1_HIGHBITDEPTH } // namespace