ref: 6a7c384764bf6d69450037b1fb2ff3dd96b5e81c
parent: 0920aafbc070e7a00d339834e8394f3dbebf6624
author: Paul Batchelor <thisispaulbatchelor@gmail.com>
date: Wed Oct 7 12:02:29 EDT 2020
better memory allocation for loadwav
--- a/modules/loadwav.c
+++ b/modules/loadwav.c
@@ -17,7 +17,7 @@
size = sp_drwav_sampcount(wav);
*ft = malloc(sizeof(sp_ftbl));
ftp = *ft;
- ftp->tbl = malloc(sizeof(SPFLOAT) * (size + 1));
+ ftp->tbl = calloc(1, sizeof(SPFLOAT) * size);
tbl = ftp->tbl;
sp_ftbl_init(sp, ftp, size);
sp_drwav_read_f32(wav, size, tbl);