Fix T61043: Blender crashes on VSE zoom / scroll timeline sometimes

This commit is contained in:
Joerg Mueller 2019-02-01 15:58:12 +01:00
parent 6cbb4c576a
commit d9d72cc9cb
Notes: blender-bot 2023-02-14 08:59:10 +01:00
Referenced by issue #61043, Blender crashes on VSE zoom / scroll timeline sometimes
1 changed files with 2 additions and 2 deletions

View File

@ -249,7 +249,7 @@ static void drawseqwave(View2D *v2d, const bContext *C, SpaceSeq *sseq, Scene *s
endsample = ceil((seq->startofs + seq->anim_startofs + seq->enddisp - seq->startdisp) / FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
samplestep = (endsample - startsample) * stepsize / (x2 - x1);
length = min_ii(floor((waveform->length - startsample) / samplestep), length);
length = min_ii(floor((waveform->length - startsample) / samplestep - (x1_offset - x1) / stepsize), length);
if (length < 2) {
return;
@ -277,7 +277,7 @@ static void drawseqwave(View2D *v2d, const bContext *C, SpaceSeq *sseq, Scene *s
value2 = waveform->data[j * 3 + 1];
}
}
else {
else if (p + 1 < waveform->length) {
/* use simple linear interpolation */
float f = sampleoffset - p;
value1 = (1.0f - f) * value1 + f * waveform->data[p * 3 + 3];