mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user