Merge "Fix arguments checking in AudioSystem::canBeSpatialized" am: 07b03bd0ac am: 708fdc1f00 am: 5ff6518830

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2201455

Change-Id: I82d7d3af0ad4986e35c5acde80682382b6dee7e3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/media/libaudioclient/AudioSystem.cpp b/media/libaudioclient/AudioSystem.cpp
index 1280577..7e4d514 100644
--- a/media/libaudioclient/AudioSystem.cpp
+++ b/media/libaudioclient/AudioSystem.cpp
@@ -2272,6 +2272,9 @@
                                     const AudioDeviceTypeAddrVector &devices,
                                     bool *canBeSpatialized) {
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
+    if (canBeSpatialized == nullptr) {
+        return BAD_VALUE;
+    }
     if (aps == 0) {
         return PERMISSION_DENIED;
     }