Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cef696e8 authored by Paul McLean's avatar Paul McLean
Browse files

Test for non-null AudioTrack() object in android_media_AudioTrack_setOutputDevice().

Change-Id: Ibf77bb0757720aa25eaaf6e603ab446257430453
parent b300d31b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -623,7 +623,7 @@ static jboolean android_media_AudioRecord_setInputDevice(

    sp<AudioRecord> lpRecorder = getAudioRecord(env, thiz);
    if (lpRecorder == 0) {
        return 0;
        return false;
    }
    return lpRecorder->setInputDevice(device_id) == NO_ERROR;
}
+3 −0
Original line number Diff line number Diff line
@@ -998,6 +998,9 @@ static jboolean android_media_AudioTrack_setOutputDevice(
                JNIEnv *env,  jobject thiz, jint device_id) {

    sp<AudioTrack> lpTrack = getAudioTrack(env, thiz);
    if (lpTrack == 0) {
        return false;
    }
    return lpTrack->setOutputDevice(device_id) == NO_ERROR;
}