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

Commit d6a86101 authored by Jeremy Wu's avatar Jeremy Wu
Browse files

Floss: fix return value of btif_av_get_peer_sep

Some codepaths on deciding whether to start a2dp depends on
the return value of `btif_av_get_peer_sep`.

However, it returns a valid value (sink) even when the peer is not found
(nil), in which case could cause btadapterd to crash at later assert
statements.

Bug: 240641968
Tag: #floss
Test: Build and verify Floss doesn't crash with repro in bug
Change-Id: I0d6839834358fd70d41406364a48ca6152012cba
parent 1e1db4e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3334,7 +3334,7 @@ uint8_t btif_av_get_peer_sep(void) {
  BtifAvPeer* peer = btif_av_find_active_peer();
  if (peer == nullptr) {
    LOG_INFO("No active sink or source peer found");
    return AVDT_TSEP_SNK;
    return AVDT_TSEP_INVALID;
  }

  uint8_t peer_sep = peer->PeerSep();