Fix nullptr check

We assume the function argument is non-null (otherwise we would
have crashed by this point).  What we really want to check here
is the result of the subfunction we've called, so we fix the
code to do that.

Test: TreeHugger
Bug: 190810951
Change-Id: I4f979c98f90b772527b270d51a25dcbfd8b122a2
This commit is contained in:
Greg Kaiser
2022-01-28 08:41:39 -08:00
parent e139c016a9
commit 9d653056a6

View File

@@ -1288,7 +1288,7 @@ static jint convertAudioProfileFromNative(JNIEnv *env, jobject *jAudioProfile,
audioFormatFromNative(nAudioProfile->format), jSamplingRates.get(),
jChannelMasks.get(), jChannelIndexMasks.get(), encapsulationType);
if (jAudioProfile == nullptr) {
if (*jAudioProfile == nullptr) {
return AUDIO_JAVA_ERROR;
}