-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix OGG Vorbis infinite error spam with corrupt file. #84723
Conversation
f99ff9e
to
75d622f
Compare
When OGG Vorbis encountered unreadable file, it emitted infinite error spam. This PR returns the full number of frames in the case of error, to prevent infinite loop.
75d622f
to
188266a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This same bug may be present on other audio readers.
I checked the other _mix_internal
and _mix_*
functions for AudioStreamPlaybackMP3, AudioStreamPlaybackMicrophone, and AudioStreamGenerator, I don't see similar problems with returning 0 that would end in infinite loops.
They do return 0 on !active
condition, which OggVorbis also does in its _mix_internal
, so I assume this is expected. But OggVorbis is the only one with ERR_FAIL
conditions as part of its actual mixing.
This makes sense to me I think. Returning zero is fine if playback is not active iirc but otherwise it makes sense to return silence. Honestly I'm really reluctant to review or approve anything that touches the interface between the audio server and the streams because Juan wants to refactor that code and I don't want to do anything that will interfere with those plans. This should be small enough that it won't cause problems in a refactor later but I also thought that about #73162. 😕 |
Thanks! |
Hello, yes I can confirm the bug in Improvement of the text |
When OGG Vorbis encountered unreadable file, it emitted infinite error spam.
This PR returns the full number of frames in the case of error, to prevent infinite loop.
Fixes #84712
Notes
Discussion
Alternatively we could set an error flag. This PR could potentially spam quite a few errors for each audio tile, but it won't enter an infinite loop. If we used an error flag this could prevent more than one error message.
I'm erring on the side of spamming here for now, unless it causes a problem in the wild, or others prefer the flag approach.