Fix crash drawing waveform with zero length sound, found looking into sound reading...
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 11 Oct 2011 14:53:27 +0000 (14:53 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 11 Oct 2011 14:53:27 +0000 (14:53 +0000)
source/blender/editors/space_sequencer/sequencer_draw.c

index 0f5398f24a71c1eb3ea80c1aa2f2105fc8f048ce..9e402de3b9da7b3162cb4fbea8859a42f2492dc2 100644 (file)
@@ -187,6 +187,9 @@ static void drawseqwave(Scene *scene, Sequence *seq, float x1, float y1, float x
                if(!seq->sound->waveform)
                        sound_read_waveform(seq->sound);
 
+               if(!seq->sound->waveform)
+                       return; /* zero length sound */
+
                waveform = seq->sound->waveform;
 
                startsample = floor((seq->startofs + seq->anim_startofs)/FPS * SOUND_WAVE_SAMPLES_PER_SECOND);