Fix T59691: Crash when deleting data-block video or audio in a video editor
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 21 Dec 2018 15:50:59 +0000 (16:50 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 21 Dec 2018 15:54:17 +0000 (16:54 +0100)
source/blender/blenkernel/intern/sound.c

index 1f1ad4c4f210746c7b673b0b3f296732c3577b6f..829f0e0ab8976060975b26ee4bbe745182f4652e 100644 (file)
@@ -532,6 +532,10 @@ void *BKE_sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Seque
 
 void *BKE_sound_add_scene_sound(struct Scene *scene, struct Sequence *sequence, int startframe, int endframe, int frameskip)
 {
+       /* Happens when sequence's sound datablock was removed. */
+       if (sequence->sound == NULL) {
+               return NULL;
+       }
        const double fps = FPS;
        void *handle = AUD_Sequence_add(scene->sound_scene, sequence->sound->playback_handle,
                                       startframe / fps, endframe / fps, frameskip / fps);