summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorBojidar Marinov <bojidar.marinov.bg@gmail.com>2019-07-16 20:58:00 +0300
committerBojidar Marinov <bojidar.marinov.bg@gmail.com>2019-07-16 20:58:00 +0300
commitea949ab873a6b7ede1a877a06114d7162a31deaa (patch)
treef43fc907efe40f21ead4171e03d8938303514ddb /scene/resources
parent22c843b0c451a0c3d79a3b3e6af900b841c51c12 (diff)
Fix invalid write in AudioStreamSample::save_to_wav
Fixes #29955
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/audio_stream_sample.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp
index 4b3e392013..5b61654c5d 100644
--- a/scene/resources/audio_stream_sample.cpp
+++ b/scene/resources/audio_stream_sample.cpp
@@ -564,7 +564,8 @@ Error AudioStreamSample::save_to_wav(const String &p_path) {
file->store_32(sub_chunk_2_size); //Subchunk2Size
// Add data
- PoolVector<uint8_t>::Read read_data = get_data().read();
+ PoolVector<uint8_t> data = get_data();
+ PoolVector<uint8_t>::Read read_data = data.read();
switch (format) {
case AudioStreamSample::FORMAT_8_BITS:
for (unsigned int i = 0; i < data_bytes; i++) {