Fix T45726: Wrong handling of 'failed to generate' audio waveform data in VSE strip draw code.

This commit is contained in:
Bastien Montagne 2015-08-07 23:42:32 +02:00
parent e96e0ddbee
commit 8af8bab0c5
Notes: blender-bot 2023-02-14 08:47:27 +01:00
Referenced by issue #45726, Segmentation fault when entering/unmetaing meta strip in sequencer
1 changed files with 7 additions and 1 deletions

View File

@ -224,7 +224,13 @@ static void drawseqwave(const bContext *C, SpaceSeq *sseq, Scene *scene, Sequenc
BLI_spin_unlock(sound->spinlock);
waveform = seq->sound->waveform;
if (waveform->length == 0) {
/* BKE_sound_read_waveform() set an empty SoundWaveform data in case it cannot generate a valid one...
* See T45726. */
return;
}
startsample = floor((seq->startofs + seq->anim_startofs) / FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
endsample = ceil((seq->startofs + seq->anim_startofs + seq->enddisp - seq->startdisp) / FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
samplestep = (endsample - startsample) * stepsize / (x2 - x1);