Merge "MediaCodec: check for exceptions when creating crypto info" am: 2f222457a2

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2281605

Change-Id: I50ec1c70d43ab765dff82ff5e64f3f6cb9136e35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-01-12 02:25:01 +00:00
committed by Automerger Merge Worker

View File

@@ -2432,13 +2432,12 @@ static void android_media_MediaCodec_native_queueLinearBlock(
throwExceptionAsNecessary(env, BAD_VALUE);
return;
}
NativeCryptoInfo cryptoInfo = [env, cryptoInfoObj, size]{
if (cryptoInfoObj == nullptr) {
return NativeCryptoInfo{size};
} else {
return NativeCryptoInfo{env, cryptoInfoObj};
}
}();
auto cryptoInfo =
cryptoInfoObj ? NativeCryptoInfo{size} : NativeCryptoInfo{env, cryptoInfoObj};
if (env->ExceptionCheck()) {
// Creation of cryptoInfo failed. Let the exception bubble up.
return;
}
err = codec->queueEncryptedLinearBlock(
index,
memory,