Skip to content

Commit

Permalink
aur: correct err handling in aurecv_receive()
Browse files Browse the repository at this point in the history
Fixes the sanitizer warning "unlock of an unlocked mutex"
  • Loading branch information
cspiel1 committed Dec 12, 2023
1 parent 6a51c3e commit 995ebc7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/aureceiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,13 @@ void aurecv_receive(struct audio_recv *ar, const struct rtp_header *hdr,
(void) lostc;

if (!mb)
goto out;
return;

mtx_lock(ar->mtx);
if (hdr->pt != ar->pt) {
mtx_unlock(ar->mtx);
*ignore = true;
goto unlock;
return;
}

*ignore = false;
Expand Down Expand Up @@ -341,7 +341,6 @@ void aurecv_receive(struct audio_recv *ar, const struct rtp_header *hdr,
return;
}

out:
/* TODO: what if lostc > 1 ?*/
/* PLC should generate lostc frames here. Not only one.
* aubuf should replace PLC frames with late arriving real frames.
Expand All @@ -351,7 +350,6 @@ void aurecv_receive(struct audio_recv *ar, const struct rtp_header *hdr,

(void)aurecv_stream_decode(ar, hdr, mb, 0, drop);

unlock:
mtx_unlock(ar->mtx);
}

Expand Down

0 comments on commit 995ebc7

Please sign in to comment.