Skip to content

Commit 4a44078

Browse files
committed
Merge pull request #106654 from jamie-pate/fix_106647
Fix Heap buffer overflow in Animation::_find()
2 parents 87e1d0e + c317549 commit 4a44078

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scene/resources/animation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2441,7 +2441,7 @@ int Animation::_find(const Vector<K> &p_keys, double p_time, bool p_backward, bo
24412441
}
24422442
}
24432443

2444-
if (p_limit) {
2444+
if (p_limit && middle > -1 && middle < len) {
24452445
double diff = length - keys[middle].time;
24462446
if ((std::signbit(keys[middle].time) && !Math::is_zero_approx(keys[middle].time)) || (std::signbit(diff) && !Math::is_zero_approx(diff))) {
24472447
ERR_PRINT_ONCE_ED("Found the key outside the animation range. Consider using the clean-up option in AnimationTrackEditor to fix it.");

0 commit comments

Comments
 (0)