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

Commit 4fbe95ed authored by John Grossman's avatar John Grossman
Browse files

Fix a segfault in AudioFlinger.



Check the string returned by a HAL's implementation of get_parameters
for NULL before attempting to make use of it.  That way, we won't
bring down the mediaserver because of a poorly written HAL.

Change-Id: Ic99d7b004520d7d6347842a681c0595e889b68ea
Signed-off-by: default avatarJohn Grossman <johngro@google.com>
parent 3540a019
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -906,7 +906,7 @@ String8 AudioFlinger::getParameters(audio_io_handle_t ioHandle, const String8& k
        for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
            audio_hw_device_t *dev = mAudioHwDevs[i];
            char *s = dev->get_parameters(dev, keys.string());
            out_s8 += String8(s);
            out_s8 += String8(s ? s : "");
            free(s);
        }
        return out_s8;