From 6f9765b3645fbe6ae785263a74ca89981b2445d7 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Sun, 14 Jan 2024 15:49:07 +0100 Subject: [PATCH] aubuf: fix coverity defect --- 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