From b76f5abdcb2993295b0110b4e751c90992114615 Mon Sep 17 00:00:00 2001 From: Shraddha Basantwani Date: Mon, 27 Mar 2023 16:00:03 +0530 Subject: [PATCH] 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 --- audio/aidl/vts/EffectHelper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/aidl/vts/EffectHelper.h b/audio/aidl/vts/EffectHelper.h index f6683cc5b1..831977be3b 100644 --- a/audio/aidl/vts/EffectHelper.h +++ b/audio/aidl/vts/EffectHelper.h @@ -228,10 +228,10 @@ class EffectHelper { */ template >> static std::set expandTestValueBasic(std::set& s) { - const auto min = *s.begin(), max = *s.rbegin(); const auto minLimit = std::numeric_limits::min(), maxLimit = std::numeric_limits::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);