[poincare/zoom] Fix array overflow

This commit is contained in:
Gabriel Ozouf
2020-12-07 16:40:06 +01:00
committed by EmilieNumworks
parent 89979b4f50
commit 55f21f127c
2 changed files with 2 additions and 2 deletions

View File

@@ -317,7 +317,7 @@ void Zoom::RangeWithRatioForDisplay(ValueAtAbscissa evaluation, float yxRatio, f
* X axis. Conversely, very flat functions may only take a small portion of
* the Y range. In those cases, the ratio is not suitable. */
if (bestBreadth < minimalXCoverage * sampleSize
|| sample[bestIndex + bestBreadth] - sample[bestIndex] < minimalYCoverage * yRange) {
|| sample[bestIndex + bestBreadth - 1] - sample[bestIndex] < minimalYCoverage * yRange) {
*xMin = NAN;
*xMax = NAN;
*yMin = NAN;