From 39a06413859a8a3f9613145e69ae9494e34b6ff4 Mon Sep 17 00:00:00 2001 From: Fabian Giesen Date: Sun, 4 Jul 2021 16:25:33 -0700 Subject: [PATCH] stb_vorbis: Clarify lifetime of pushdata *output buffers Fixes issue #929. --- stb_vorbis.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stb_vorbis.c b/stb_vorbis.c index da1767d..4cd1699 100644 --- a/stb_vorbis.c +++ b/stb_vorbis.c @@ -223,6 +223,12 @@ extern int stb_vorbis_decode_frame_pushdata( // channel. In other words, (*output)[0][0] contains the first sample from // the first channel, and (*output)[1][0] contains the first sample from // the second channel. +// +// *output points into stb_vorbis's internal output buffer storage; these +// buffers are owned by stb_vorbis and application code should not free +// them or modify their contents. They are transient and will be overwritten +// once you ask for more data to get decoded, so be sure to grab any data +// you need before then. extern void stb_vorbis_flush_pushdata(stb_vorbis *f); // inform stb_vorbis that your next datablock will not be contiguous with