Merge "Check for null buffer when calling Transaction#setBuffer" into tm-dev am: 4c850d741b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18501090 Change-Id: Idd607b4ebac1b1630a1b05fbdc5da9cc3db2bfc3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -688,8 +688,11 @@ static void nativeSetBuffer(JNIEnv* env, jclass clazz, jlong transactionObj, jlo
|
|||||||
jobject bufferObject, jlong fencePtr, jobject releaseCallback) {
|
jobject bufferObject, jlong fencePtr, jobject releaseCallback) {
|
||||||
auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
|
auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
|
||||||
SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl*>(nativeObject);
|
SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl*>(nativeObject);
|
||||||
sp<GraphicBuffer> graphicBuffer(GraphicBuffer::fromAHardwareBuffer(
|
sp<GraphicBuffer> graphicBuffer;
|
||||||
android_hardware_HardwareBuffer_getNativeHardwareBuffer(env, bufferObject)));
|
if (bufferObject != nullptr) {
|
||||||
|
graphicBuffer = GraphicBuffer::fromAHardwareBuffer(
|
||||||
|
android_hardware_HardwareBuffer_getNativeHardwareBuffer(env, bufferObject));
|
||||||
|
}
|
||||||
std::optional<sp<Fence>> optFence = std::nullopt;
|
std::optional<sp<Fence>> optFence = std::nullopt;
|
||||||
if (fencePtr != 0) {
|
if (fencePtr != 0) {
|
||||||
optFence = sp<Fence>{reinterpret_cast<Fence*>(fencePtr)};
|
optFence = sp<Fence>{reinterpret_cast<Fence*>(fencePtr)};
|
||||||
|
|||||||
Reference in New Issue
Block a user