From 768c6f94d6fa8e2cb779929a61a811660f724e23 Mon Sep 17 00:00:00 2001 From: jiabin Date: Wed, 12 Apr 2023 23:46:55 +0000 Subject: [PATCH] AHAL: use PCM_FORMAT_INVALID as the termination of format array. Bug: 266216550 Test: make Change-Id: Ibe2056eb4fdecb14c3e25daa3dbdd769d6433136 --- audio/aidl/default/usb/ModuleUsb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/aidl/default/usb/ModuleUsb.cpp b/audio/aidl/default/usb/ModuleUsb.cpp index 89895bf13a..ecdbd5cb77 100644 --- a/audio/aidl/default/usb/ModuleUsb.cpp +++ b/audio/aidl/default/usb/ModuleUsb.cpp @@ -132,7 +132,7 @@ ndk::ScopedAStatus ModuleUsb::populateConnectedDevicePort(AudioPort* audioPort) std::vector sampleRates = populateSampleRatesFromProfile(&profile); for (size_t i = 0; i < std::min(MAX_PROFILE_FORMATS, AUDIO_PORT_MAX_AUDIO_PROFILES) && - profile.formats[i] != 0; + profile.formats[i] != PCM_FORMAT_INVALID; ++i) { auto audioFormatDescription = usb::legacy2aidl_pcm_format_AudioFormatDescription(profile.formats[i]);