Fix T61043: Blender crashes on VSE zoom / scroll timeline sometimes
This commit is contained in:
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
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue