Fix #110333: Sound strip length not correct when opening old file

Commit `c9be925f7d` fixed files for studio, that were saved in incorrect
state. This also attempted to fix unaffected files.
In affected files `seq->startofs` did overflow. Sound strips are not
expected to have negative `startofs` and therefore fix in `c9be925f7d`
can be limited to broken files by checking `startofs` value.
This commit is contained in:
Richard Antalik
2023-07-31 22:20:18 +02:00
parent 76817e5951
commit 61ee554e3f

View File

@@ -1764,7 +1764,12 @@ static bool version_seq_fix_broken_sound_strips(Sequence *seq, void * /*user_dat
seq->speed_factor = 1.0f;
SEQ_retiming_data_clear(seq);
seq->startofs = 0.0f;
/* Broken files do have negative start offset, which should not be present in sound strips. */
if (seq->startofs < 0) {
seq->startofs = 0.0f;
}
return true;
}