Merge pull request #106654 from jamie-pate/fix_106647

Fix Heap buffer overflow in Animation::_find()
This commit is contained in:
Thaddeus Crews 2025-05-21 09:06:28 -05:00
commit 4a44078451
No known key found for this signature in database
GPG Key ID: 8C6E5FEB5FC03CCC

View File

@ -2441,7 +2441,7 @@ int Animation::_find(const Vector<K> &p_keys, double p_time, bool p_backward, bo
}
}
if (p_limit) {
if (p_limit && middle > -1 && middle < len) {
double diff = length - keys[middle].time;
if ((std::signbit(keys[middle].time) && !Math::is_zero_approx(keys[middle].time)) || (std::signbit(diff) && !Math::is_zero_approx(diff))) {
ERR_PRINT_ONCE_ED("Found the key outside the animation range. Consider using the clean-up option in AnimationTrackEditor to fix it.");