From fd0c9fcaccbbb284f00c3403152bd3faf5940888 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 8 Jul 2020 20:42:57 +0200 Subject: [PATCH] Multiply instead of shifting The shift operator is undefined for negative values. Fixes: oss-fuzz-23735 Pick-to: 5.15 5.12 Change-Id: Ib4bad0bf2135f9ddc95f6d7de64d935a02b4791e Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qcosmeticstroker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index c67d5ab1cef..001c44696a9 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -474,7 +474,7 @@ void QCosmeticStroker::calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal qSwap(y1, y2); } int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1); - int y = y1 << 10; + int y = y1 * (1 << 10); int x = (x1 + 32) >> 6; int xs = (x2 + 32) >> 6;