-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 crash when trying to load an invalid mp3 file #55502
Conversation
Looks good! Please also update the commit hash for minimp3 in |
modules/minimp3/audio_stream_mp3.cpp
Outdated
@@ -165,7 +161,7 @@ void AudioStreamMP3::set_data(const Vector<uint8_t> &p_data) { | |||
|
|||
mp3dec_ex_t mp3d; | |||
int err = mp3dec_ex_open_buf(&mp3d, src_datar, src_data_len, MP3D_SEEK_TO_SAMPLE); | |||
ERR_FAIL_COND(err != 0); | |||
ERR_FAIL_COND(err || mp3d.info.hz == 0); |
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.
Maybe this can be given an explicit error message with the _MSG
variant of the macro, as otherwise this might be a bit cryptic to users (especially as this often would happen in a chain reaction of failed loading errors).
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.
Good point! I've gone ahead and updated the commit; should hopefully be all good now.
029ffee
to
2d0068d
Compare
Thanks! |
Cherry-picked for 3.5. I only cherry-picked the library update + the new error check, as the refactoring seemed not to be valid in For |
Cherry-picked for 3.4.1. |
I was wondering about that as well at first, but I think it's just due to how the new implementation of |
This should fix #55457 by adding an additional check for mp3 file validity.
Additionally, minimp3 is updated to the newest version.