From 695b2045458123c6533b9df3b33bca00f0e3e5d5 Mon Sep 17 00:00:00 2001 From: Cong Lin Date: Tue, 11 Jul 2023 11:13:21 -0700 Subject: [PATCH] Add test for zero subsample size Decrypting zero subsample size should return success. Test: opk_ta, run_fake_l1_tests, run_dynamic_level3 Bug: 279999069 Merged from https://widevine-internal-review.googlesource.com/178138 Change-Id: I3bbad9c63ee72bd6e8ea3b796d231116e59afdc7 --- .../oemcrypto/test/oemcrypto_decrypt_test.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_decrypt_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_decrypt_test.cpp index 4c0a71d7..a61c8933 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_decrypt_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_decrypt_test.cpp @@ -539,6 +539,17 @@ TEST_P(OEMCryptoSessionTestsDecryptTests, DecryptMaxSubsample) { ASSERT_NO_FATAL_FAILURE(TestDecryptCENC()); } +TEST_P(OEMCryptoSessionTestsDecryptTests, DecryptZeroSizeSubSample) { + ASSERT_NO_FATAL_FAILURE(SetSubsampleSizes({ + {10, 10}, + {0, 0}, + })); + ASSERT_NO_FATAL_FAILURE(LoadLicense()); + ASSERT_NO_FATAL_FAILURE(MakeBuffers()); + ASSERT_NO_FATAL_FAILURE(EncryptData()); + ASSERT_NO_FATAL_FAILURE(TestDecryptCENC()); +} + // There are probably no frames this small, but we should handle them anyway. TEST_P(OEMCryptoSessionTestsDecryptTests, DecryptSmallBuffer) { ASSERT_NO_FATAL_FAILURE(SetSubsampleSizes({