From af5a81faf81d2cea996c071011a4bd5528764a64 Mon Sep 17 00:00:00 2001 From: DeeJayLSP Date: Sun, 14 Sep 2025 11:19:19 -0300 Subject: [PATCH] Add one padding frame to QOA buffer for short streams --- scene/resources/audio_stream_wav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/audio_stream_wav.cpp b/scene/resources/audio_stream_wav.cpp index 6ecf9992c0f..5f3b8a0b4e9 100644 --- a/scene/resources/audio_stream_wav.cpp +++ b/scene/resources/audio_stream_wav.cpp @@ -616,7 +616,7 @@ Ref AudioStreamWAV::instantiate_playback() { uint32_t ffp = qoa_decode_header(data.ptr(), data_bytes, &sample->qoa.desc); ERR_FAIL_COND_V(ffp != 8, Ref()); sample->qoa.frame_len = qoa_max_frame_size(&sample->qoa.desc); - int samples_len = (sample->qoa.desc.samples > QOA_FRAME_LEN ? QOA_FRAME_LEN : sample->qoa.desc.samples); + int samples_len = sample->qoa.desc.samples > QOA_FRAME_LEN ? QOA_FRAME_LEN : (sample->qoa.desc.samples + 1); int dec_len = sample->qoa.desc.channels * samples_len; sample->qoa.dec.resize(dec_len); }