diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2021-08-16 17:50:54 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-08-23 12:55:26 +0300 |
commit | 1a4122d4415b05e3a106d93cda36e8e9c74c02f5 (patch) | |
tree | 3fc89f3775c3504c1c34f02aaeeccfab27f13a53 | |
parent | e97a2c228ef546ec96c10d93b94063cba06ca0b8 (diff) |
Add sanity NULL checks when loading sound sequences
Would cause crashes in files that had lingering invalid sound sequences around.
For example our tests/render/volume/fire.blend test file.
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 284c5db10b3..b4a199382c1 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -703,7 +703,7 @@ void *BKE_sound_scene_add_scene_sound( Scene *scene, Sequence *sequence, int startframe, int endframe, int frameskip) { sound_verify_evaluated_id(&scene->id); - if (sequence->scene && scene != sequence->scene) { + if (sequence->scene && scene != sequence->scene && sequence->sound) { const double fps = FPS; return AUD_Sequence_add(scene->sound_scene, sequence->scene->sound_scene, @@ -775,7 +775,7 @@ void BKE_sound_move_scene_sound( void BKE_sound_move_scene_sound_defaults(Scene *scene, Sequence *sequence) { sound_verify_evaluated_id(&scene->id); - if (sequence->scene_sound) { + if (sequence->scene_sound && sequence->sound) { BKE_sound_move_scene_sound(scene, sequence->scene_sound, sequence->startdisp, |