Fix for [#26160] Blender Crashes when undoing
authorJoerg Mueller <nexyon@gmail.com>
Tue, 22 Feb 2011 16:32:05 +0000 (16:32 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Tue, 22 Feb 2011 16:32:05 +0000 (16:32 +0000)
Was trying to free audio data from sequencer strips that don't even have audio. Corrected the error in several ways so this will definitely not happen again :-)

source/blender/blenkernel/intern/sequencer.c
source/blender/blenloader/intern/readfile.c

index 2785878..69d8713 100644 (file)
@@ -193,7 +193,7 @@ void seq_free_sequence(Scene *scene, Sequence *seq)
                if (ed->act_seq==seq)
                        ed->act_seq= NULL;
 
-               if(seq->scene_sound)
+               if(seq->scene_sound && ELEM(seq->type, SEQ_SOUND, SEQ_SCENE))
                        sound_remove_scene_sound(scene, seq->scene_sound);
 
                seq_free_animdata(scene, seq);
@@ -3399,6 +3399,7 @@ Sequence *alloc_sequence(ListBase *lb, int cfra, int machine)
        seq->mul= 1.0;
        seq->blend_opacity = 100.0;
        seq->volume = 1.0f;
+       seq->scene_sound = NULL;
 
        return seq;
 }
index 8501c11..0b4b27b 100644 (file)
@@ -4368,6 +4368,7 @@ static void lib_link_scene(FileData *fd, Main *main)
 
                        SEQ_BEGIN(sce->ed, seq) {
                                if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
+                               seq->scene_sound = NULL;
                                if(seq->scene) {
                                        seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
                                        seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);