From 3b945c0741e1bece77b4da787844479aeaa0386a Mon Sep 17 00:00:00 2001 From: Timothy Schoen <44585538+timothyschoen@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:50:57 +0200 Subject: [PATCH] Fixed crash in [vectral] when resizing to a size larger than the initial size --- cyclone_objects/binaries/audio/vectral.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cyclone_objects/binaries/audio/vectral.c b/cyclone_objects/binaries/audio/vectral.c index a529066d..707f5e51 100644 --- a/cyclone_objects/binaries/audio/vectral.c +++ b/cyclone_objects/binaries/audio/vectral.c @@ -194,7 +194,9 @@ static void vectral_free(t_vectral *x){ } static void vectral_size(t_vectral *x, t_floatarg f){ + int last_bufsize = x->x_bufsize; x->x_bufsize = (int)f < 64 ? 64 : (int)f; + x->x_buffer = resizebytes(x->x_buffer, last_bufsize * sizeof(*x->x_buffer), x->x_bufsize * sizeof(*x->x_buffer)); } static void vectral_clear(t_vectral *x){