diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2021-12-16 09:04:01 +0100 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2021-12-21 20:36:34 +0100 |
| commit | 52da10f64542a6c4fda06be1b88e9111331f6500 (patch) | |
| tree | e7f991dd4739dc51d07839bddb220e817bda92fc /src/corelib/tools/qringbuffer.cpp | |
| parent | b330016cf25ed4eae95958213b746d718ac644d2 (diff) | |
QVariantAnimation: fix UB (FP 0/0) in interpolated() arg calculation
When startProgress, endProgress, and progress were all 0 (as provoked
by tst_QPropertyAnimation::startWithoutStartValue()), we'd calculate
0/0 and ubsan complained:
qvariantanimation.cpp:284:60: runtime error: division by zero
Fix by detecting progress - startProgress == 0 and setting
localProgress = 0.0 in that case. This is a logical result, even
though it might not be what IEEE754 rules would have yielded.
A more comprehensive change that aims to reliably keep localProgress
∈ [0,1] and thus avoid the infinities when endProgress ==
startProgress, is outside the scope of this patch, which deals only
with the UBSan error.
Pick-to: 6.3 6.2 5.15
Change-Id: I5258b054a2060006795f49fb1cd7604aea3ed46b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/corelib/tools/qringbuffer.cpp')
0 files changed, 0 insertions, 0 deletions
