From f25da522a476cfe93adbb7daecd47f3bb970989b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 31 Aug 2023 11:39:54 +0200 Subject: [PATCH] pulse-tunnel: fix index after overrun First advance the index, then fix the avail value or else we don't end up changing the index at all. --- src/modules/module-pulse-tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-pulse-tunnel.c b/src/modules/module-pulse-tunnel.c index eda3fafef..1857c3431 100644 --- a/src/modules/module-pulse-tunnel.c +++ b/src/modules/module-pulse-tunnel.c @@ -399,8 +399,8 @@ static void capture_stream_process(void *d) if (avail < (int32_t)size) memset(bd->data, 0, size); if (avail > (int32_t)RINGBUFFER_SIZE) { - avail = impl->target_buffer; index += avail - impl->target_buffer; + avail = impl->target_buffer; } if (avail > 0) { avail = SPA_ROUND_DOWN(avail, impl->frame_size);