Skip to content

Commit 7b90590

Browse files
committed
Merge pull request #100422 from hpvb/from-the-depth-of-despair
Fix a crash trying to save an empty AudioStream
2 parents 90555e6 + eb948bc commit 7b90590

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scene/resources/audio_stream_wav.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ void AudioStreamWAV::set_data(const Vector<uint8_t> &p_data) {
587587
Vector<uint8_t> AudioStreamWAV::get_data() const {
588588
Vector<uint8_t> pv;
589589

590-
if (!data.is_empty()) {
590+
if (data_bytes) {
591591
pv.resize(data_bytes);
592592
memcpy(pv.ptrw(), data.ptr() + DATA_PAD, data_bytes);
593593
}

0 commit comments

Comments
 (0)