Fix crash drawing waveform with zero length sound, found looking into sound reading bug.

This commit is contained in:
Brecht Van Lommel
2011-10-11 14:53:27 +00:00
parent 79f21f88c2
commit 1997cba227

View 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);