Fix #113890: Buffer overread when rendering after strip content range

Caused by incorrect frame index clamping in `SEQ_give_frame_index()`.
This commit is contained in:
Richard Antalik
2023-10-24 04:37:34 +02:00
parent ca32ba33ae
commit 79b1eacba9

View File

@@ -68,7 +68,7 @@ float SEQ_give_frame_index(const Scene *scene, Sequence *seq, float timeline_fra
float frame_index;
float sta = SEQ_time_start_frame_get(seq);
float end = SEQ_time_content_end_frame_get(scene, seq) - 1;
const float length = seq->len;
const float frame_index_max = seq->len - 1;
if (seq->type & SEQ_TYPE_EFFECT) {
end = SEQ_time_right_handle_frame_get(scene, seq);
@@ -95,10 +95,10 @@ float SEQ_give_frame_index(const Scene *scene, Sequence *seq, float timeline_fra
if (SEQ_retiming_is_active(seq)) {
const float retiming_factor = seq_retiming_evaluate(seq, frame_index);
frame_index = retiming_factor * (length);
frame_index = retiming_factor * frame_index_max;
}
/* Clamp frame index to strip content frame range. */
frame_index = clamp_f(frame_index, 0, length);
frame_index = clamp_f(frame_index, 0, frame_index_max);
if (seq->strobe < 1.0f) {
seq->strobe = 1.0f;