From ab39b46b148e4f2a27cc2aa23efa65aea907e0d0 Mon Sep 17 00:00:00 2001 From: Archie Pusaka Date: Tue, 1 Sep 2020 12:00:00 +0800 Subject: [PATCH] audio/transport: Don't set volume if it's invalid Adding a check inside media_transport_update_volume to prevent the volume being updated with an invalid value. --- profiles/audio/transport.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index a2c4f7dfb..dd1c553a2 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -941,6 +941,9 @@ void media_transport_update_volume(struct media_transport *transport, { struct a2dp_transport *a2dp = transport->data; + if (volume < 0) + return; + /* Check if volume really changed */ if (a2dp->volume == volume) return; -- 2.47.3