Merge "Audio Effect : Add checks to validate the channel count" into main am: a10d3c536f

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2902252

Change-Id: Id28f194bbcad3534a27429bea35b894c4b2abc32
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2024-01-10 01:47:23 +00:00
committed by Automerger Merge Worker

View File

@@ -46,6 +46,14 @@ class EffectContext {
LOG_ALWAYS_FATAL_IF(output.base.format.pcm != LOG_ALWAYS_FATAL_IF(output.base.format.pcm !=
aidl::android::media::audio::common::PcmType::FLOAT_32_BIT, aidl::android::media::audio::common::PcmType::FLOAT_32_BIT,
"outputFormatNotFloat"); "outputFormatNotFloat");
size_t inputChannelCount =
::aidl::android::hardware::audio::common::getChannelCount(input.base.channelMask);
LOG_ALWAYS_FATAL_IF(inputChannelCount == 0, "inputChannelCountNotValid");
size_t outputChannelCount =
::aidl::android::hardware::audio::common::getChannelCount(output.base.channelMask);
LOG_ALWAYS_FATAL_IF(outputChannelCount == 0, "outputChannelCountNotValid");
mInputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes( mInputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(
input.base.format, input.base.channelMask); input.base.format, input.base.channelMask);
mOutputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes( mOutputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(