diff --git a/apps/shared/curve_view.cpp b/apps/shared/curve_view.cpp index 186003521..ec745db4a 100644 --- a/apps/shared/curve_view.cpp +++ b/apps/shared/curve_view.cpp @@ -412,6 +412,10 @@ void CurveView::drawHorizontalOrVerticalSegment(KDContext * ctx, KDRect rect, Ax if (dashSize < 0) { // Continuous segment is equivalent to one big dash dashSize = end - start; + if (dashSize < 0) { + // end-start overflowed + dashSize = KDCOORDINATE_MAX; + } } KDRect lineRect = KDRectZero; for (KDCoordinate i = start; i < end; i += 2*dashSize) {