summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-08-30 20:01:14 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-08-30 20:01:14 +0200
commit2cd2197362d88dd582539525cf7ea59b391c0438 (patch)
treec789ff86ff318435003e76b7a0e07b5b19879bbd
parent208dd5b4a657e616af9f3da5e690a85247079847 (diff)
Fix crash when AudioStreamOGGVorbis is empty
-rw-r--r--editor/plugins/editor_preview_plugins.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index c8ffc2744a..8acc41a2c7 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -624,6 +624,7 @@ Ref<Texture> EditorAudioStreamPreviewPlugin::generate(const RES &p_from, const S
uint8_t *imgw = imgdata.ptr();
Ref<AudioStreamPlayback> playback = stream->instance_playback();
+ ERR_FAIL_COND_V(playback.is_null(), Ref<Texture>());
float len_s = stream->get_length();
if (len_s == 0) {