diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2021-08-16 17:50:54 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2021-08-16 17:52:38 +0300 |
commit | 035d4c28abaf351b36ff5bb6057f865888790331 (patch) | |
tree | 41151a628f32ebf0e6be89828d014237e54a57ee /source/blender/blenkernel | |
parent | df3884d51244a8a08c62308a3d7e84011090df8b (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.
Diffstat (limited to 'source/blender/blenkernel')
-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 bd0fbd840ff..8730d2758e6 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, |