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

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

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

View File

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