From 1078dc292a8b4f4174d753a434cdaf12f806c284 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 15 Feb 2026 08:11:57 +1000 Subject: [PATCH] Add a safety check to `ma_data_source_read_pcm_frames_within_range()`. Public issue https://github.com/mackron/miniaudio/pull/1095 --- miniaudio.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miniaudio.h b/miniaudio.h index b028c2e9..bf7d125a 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -59262,6 +59262,10 @@ static ma_result ma_data_source_read_pcm_frames_within_range(ma_data_source* pDa ma_uint64 framesRead = 0; ma_bool32 loop = ma_data_source_is_looping(pDataSource); + if (pFramesRead != NULL) { + *pFramesRead = 0; + } + if (pDataSourceBase == NULL) { return MA_AT_END; }