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

Commit 2cb8784d 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: I45f0fd3de003151f98acf32c36c42f58d053f3a0
parent 4dd8338b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -923,7 +923,7 @@ String8 AudioFlinger::getParameters(int ioHandle, const String8& keys)
        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;