Merge "libmedia: Fix null pointer crash in secure buffer allocation."

gugelfrei
TreeHugger Robot 7 years ago committed by Android (Google) Code Review
commit 21f6d6cbec

@ -151,7 +151,8 @@ status_t LWOmxNode::allocateSecureBuffer(
hidl_handle const& outNativeHandle) {
fnStatus = toStatusT(status);
*buffer = outBuffer;
*native_handle = NativeHandle::create(
*native_handle = outNativeHandle.getNativeHandle() == nullptr ?
nullptr : NativeHandle::create(
native_handle_clone(outNativeHandle), true);
}));
return transStatus == NO_ERROR ? fnStatus : transStatus;

@ -154,7 +154,8 @@ status_t LWOmxNode::allocateSecureBuffer(
hidl_handle const& outNativeHandle) {
fnStatus = toStatusT(status);
*buffer = outBuffer;
*native_handle = NativeHandle::create(
*native_handle = outNativeHandle.getNativeHandle() == nullptr ?
nullptr : NativeHandle::create(
native_handle_clone(outNativeHandle), true);
}));
return transStatus == NO_ERROR ? fnStatus : transStatus;

Loading…
Cancel
Save