Merge pull request #56903 from akien-mga/3.x-ogg-clearer-errors

This commit is contained in:
Rémi Verschelde 2022-01-27 12:43:04 +01:00 committed by GitHub
commit 9c417f5118
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -185,8 +185,8 @@ void AudioStreamOGGVorbis::set_data(const PoolVector<uint8_t> &p_data) {
w.release();
alloc_try *= 2;
} else {
ERR_FAIL_COND(alloc_try == MAX_TEST_MEM);
ERR_FAIL_COND(ogg_stream == nullptr);
ERR_FAIL_COND_MSG(alloc_try == MAX_TEST_MEM, "Failed allocating memory for OGG Vorbis stream.");
ERR_FAIL_COND_MSG(!ogg_stream, "OGG Vorbis decoding failed. Check that your data is a valid OGG Vorbis audio stream.");
stb_vorbis_info info = stb_vorbis_get_info(ogg_stream);

View file

@ -91,7 +91,7 @@ Error ResourceImporterOGGVorbis::import(const String &p_source_file, const Strin
ogg_stream.instance();
ogg_stream->set_data(data);
ERR_FAIL_COND_V(!ogg_stream->get_data().size(), ERR_FILE_CORRUPT);
ERR_FAIL_COND_V_MSG(!ogg_stream->get_data().size(), ERR_FILE_CORRUPT, "Couldn't import file as AudioStreamOGGVorbis: " + p_source_file);
ogg_stream->set_loop(loop);
ogg_stream->set_loop_offset(loop_offset);