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

Commit e3556718 authored by Eric Laurent's avatar Eric Laurent Committed by Gerrit Code Review
Browse files

Merge "[BUG] audiopolicy: engineconfigurable: prevent illegal map access"

parents f399647e 6f52ff9e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -299,8 +299,13 @@ DeviceVector Engine::getOutputDevicesForAttributes(const audio_attributes_t &att
    if (device != nullptr) {
        return DeviceVector(device);
    }
    return fromCache? getCachedDevices(strategy) : getDevicesForProductStrategy(strategy);
}

    return fromCache? mDevicesForStrategies.at(strategy) : getDevicesForProductStrategy(strategy);
DeviceVector Engine::getCachedDevices(product_strategy_t ps) const
{
    return mDevicesForStrategies.find(ps) != mDevicesForStrategies.end() ?
                mDevicesForStrategies.at(ps) : DeviceVector{};
}

DeviceVector Engine::getOutputDevicesForStream(audio_stream_type_t stream, bool fromCache) const
+1 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ private:
    status_t loadAudioPolicyEngineConfig();

    DeviceVector getDevicesForProductStrategy(product_strategy_t strategy) const;
    DeviceVector getCachedDevices(product_strategy_t ps) const;

    /**
     * Policy Parameter Manager hidden through a wrapper.