From 4e71cfc77203cb45e916f81998dfb97d85ecbd96 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Mon, 15 Jan 2024 17:57:31 +0100 Subject: [PATCH] aubuf: fix coverity defect (#1051) --- rem/aubuf/aubuf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rem/aubuf/aubuf.c b/rem/aubuf/aubuf.c index 71409bc3b..f2b300f83 100644 --- a/rem/aubuf/aubuf.c +++ b/rem/aubuf/aubuf.c @@ -352,10 +352,12 @@ void aubuf_read_auframe(struct aubuf *ab, struct auframe *af) return; sz = auframe_size(af); + + mtx_lock(ab->lock); + if (!ab->ajb && ab->mode == AUBUF_ADAPTIVE) ab->ajb = ajb_alloc(ab->silence, ab->wish_sz); - mtx_lock(ab->lock); as = ajb_get(ab->ajb, af); if (as == AJB_LOW) { #if AUBUF_DEBUG