From e1a3abe9e7b20badc7c9c1bb5f3ee022c33e83ba Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 23 Mar 2023 10:43:56 +1000 Subject: [PATCH] Fix a bug with `ma_vfs_read()`. This is not pre-initializing the variable that receives the number of bytes read to 0 which can result in custom VFS implementations returning an invalid value if they return early from an error or whatnot. --- miniaudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index 66ffdc65..83b42ede 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -58510,7 +58510,7 @@ MA_API ma_result ma_vfs_read(ma_vfs* pVFS, ma_vfs_file file, void* pDst, size_t { ma_vfs_callbacks* pCallbacks = (ma_vfs_callbacks*)pVFS; ma_result result; - size_t bytesRead; + size_t bytesRead = 0; if (pBytesRead != NULL) { *pBytesRead = 0;