diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-11-10 21:56:59 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-11-10 21:56:59 +0100 |
commit | e38686f85b768a451dc06324fe2471adc8665448 (patch) | |
tree | fbfc045b7b85a7b3b406c9db4bc3f99029a5d74a | |
parent | 17a18fad46d93e45992c26e7c069503df5042bab (diff) | |
parent | 188266af4704a36415b1e98956ecda34d4a025b2 (diff) | |
download | redot-engine-e38686f85b768a451dc06324fe2471adc8665448.tar.gz |
Merge pull request #84723 from lawnjelly/fix_vorbis_inf_loop
Fix OGG Vorbis infinite error spam with corrupt file.
-rw-r--r-- | modules/vorbis/audio_stream_ogg_vorbis.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 8a265ffaf3..7ec0b697bf 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -144,7 +144,7 @@ int AudioStreamPlaybackOggVorbis::_mix_internal(AudioFrame *p_buffer, int p_fram } int AudioStreamPlaybackOggVorbis::_mix_frames_vorbis(AudioFrame *p_buffer, int p_frames) { - ERR_FAIL_COND_V(!ready, 0); + ERR_FAIL_COND_V(!ready, p_frames); if (!have_samples_left) { ogg_packet *packet = nullptr; int err; @@ -156,10 +156,10 @@ int AudioStreamPlaybackOggVorbis::_mix_frames_vorbis(AudioFrame *p_buffer, int p } err = vorbis_synthesis(&block, packet); - ERR_FAIL_COND_V_MSG(err != 0, 0, "Error during vorbis synthesis " + itos(err)); + ERR_FAIL_COND_V_MSG(err != 0, p_frames, "Error during vorbis synthesis " + itos(err)); err = vorbis_synthesis_blockin(&dsp_state, &block); - ERR_FAIL_COND_V_MSG(err != 0, 0, "Error during vorbis block processing " + itos(err)); + ERR_FAIL_COND_V_MSG(err != 0, p_frames, "Error during vorbis block processing " + itos(err)); have_packets_left = !packet->e_o_s; } |