Merge "Audio : Fix ASAN crash in VTS test cases"

This commit is contained in:
Treehugger Robot 2023-03-28 05:55:23 +00:00 committed by Gerrit Code Review
commit 5e311b67f4

View file

@ -228,10 +228,10 @@ class EffectHelper {
*/ */
template <typename S, typename = std::enable_if_t<std::is_arithmetic_v<S>>> template <typename S, typename = std::enable_if_t<std::is_arithmetic_v<S>>>
static std::set<S> expandTestValueBasic(std::set<S>& 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(), const auto minLimit = std::numeric_limits<S>::min(),
maxLimit = std::numeric_limits<S>::max(); maxLimit = std::numeric_limits<S>::max();
if (s.size()) { if (s.size()) {
const auto min = *s.begin(), max = *s.rbegin();
s.insert(min + (max - min) / 2); s.insert(min + (max - min) / 2);
if (min != minLimit) { if (min != minLimit) {
s.insert(min - 1); s.insert(min - 1);