Merge pull request #100422 from hpvb/from-the-depth-of-despair

Fix a crash trying to save an empty AudioStream
This commit is contained in:
Rémi Verschelde 2024-12-18 00:39:53 +01:00
commit 7b90590e85
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -587,7 +587,7 @@ void AudioStreamWAV::set_data(const Vector<uint8_t> &p_data) {
Vector<uint8_t> AudioStreamWAV::get_data() const {
Vector<uint8_t> pv;
if (!data.is_empty()) {
if (data_bytes) {
pv.resize(data_bytes);
memcpy(pv.ptrw(), data.ptr() + DATA_PAD, data_bytes);
}