mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Fail mp3 loading when attempting to load invalid mp3s
This also adds a warning for unspecified MP3 loading error codes
(cherry picked from commit 936767deca)
This commit is contained in:
committed by
Rémi Verschelde
parent
ec0085973f
commit
5db83defcd
@@ -159,7 +159,8 @@ void AudioStreamMP3::set_data(const PoolVector<uint8_t> &p_data) {
|
||||
PoolVector<uint8_t>::Read src_datar = p_data.read();
|
||||
|
||||
mp3dec_ex_t mp3d;
|
||||
mp3dec_ex_open_buf(&mp3d, src_datar.ptr(), src_data_len, MP3D_SEEK_TO_SAMPLE);
|
||||
int err = mp3dec_ex_open_buf(&mp3d, src_datar.ptr(), src_data_len, MP3D_SEEK_TO_SAMPLE);
|
||||
ERR_FAIL_COND(err != 0);
|
||||
|
||||
channels = mp3d.info.channels;
|
||||
sample_rate = mp3d.info.hz;
|
||||
|
||||
Reference in New Issue
Block a user