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

Commit b76f5abd authored by Shraddha Basantwani's avatar Shraddha Basantwani
Browse files

Audio : Fix ASAN crash in VTS test cases

Effect Helper should not try to access min/max values of a tag
when it is not defined.

Bug: 271912230
Test: atest VtsHalAECTargetTest.cpp (with ASAN enabled)

Change-Id: Idf47a521fbd594c83ab0fc21f2750673652b3aee
parent 85eac306
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -228,10 +228,10 @@ class EffectHelper {
     */
    template <typename S, typename = std::enable_if_t<std::is_arithmetic_v<S>>>
    static std::set<S> expandTestValueBasic(std::set<S>& s) {
        const auto min = *s.begin(), max = *s.rbegin();
        const auto minLimit = std::numeric_limits<S>::min(),
                   maxLimit = std::numeric_limits<S>::max();
        if (s.size()) {
            const auto min = *s.begin(), max = *s.rbegin();
            s.insert(min + (max - min) / 2);
            if (min != minLimit) {
                s.insert(min - 1);