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

Commit 1bad4f10 authored by Sohail Nagaraj's avatar Sohail Nagaraj
Browse files

Fix: Add missing null check for createAudioSource in setupRTPRecording

Add a null check for createAudioSource similar to the setupVideoEncoder
check. This prevents RTPWriter instantiating with an invalid audio
source.

Bug: 385263014
Bug: 377593888

Test: ./mediarecorder_fuzzer
Change-Id: I7537695f3f31ba02cdd1a54460116dcbbcbd88cf
parent 8662f897
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1568,6 +1568,9 @@ status_t StagefrightRecorder::setupRTPRecording() {

    if (mAudioSource != AUDIO_SOURCE_CNT) {
        source = createAudioSource();
        if (source == NULL) {
            return UNKNOWN_ERROR;
        }
        mAudioEncoderSource = source;
    } else {
        setDefaultVideoEncoderIfNecessary();