[app/shared] CurveView: Avoid dashSize overflow in

drawHorizontalOrVerticalSegment
This commit is contained in:
Émilie Feral
2020-10-07 17:09:14 +02:00
committed by LeaNumworks
parent 8e025b0823
commit c91c2a6e3f

View File

@@ -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) {