From 36f35fa226d028533f64e49eafbdcd829b1d7ec1 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 21 Nov 2023 15:44:31 -0800 Subject: modules/playit: tomix must be signed to handle negatives This can potentially be negative depending on what n_queued returns, and the early-exit comparison considered that by using <= 0 but size_t is unsigned, so it just wraps around then segfaults in the Very Large Copy attempt. Trivial fix, interestingly discovered during windows testing where the SDL driver was readily causing this to go negative - it never happend in linux testing. --- src/modules/playit/playit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/playit/playit.c b/src/modules/playit/playit.c index e70a631..638c147 100644 --- a/src/modules/playit/playit.c +++ b/src/modules/playit/playit.c @@ -115,7 +115,7 @@ static void playit_render_audio(til_module_context_t *context, til_stream_t *str { playit_context_t *ctxt = (playit_context_t *)context; playit_setup_t *s = (playit_setup_t *)context->setup; - size_t tomix = s->bufsize; + ssize_t tomix = s->bufsize; unsigned frame, frames; if (ctxt->paused) -- cgit v1.2.3