summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-03-25 15:04:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-28 22:52:19 +0100
commitc4d8734c504cf0f313245befa34501e7314b4cd1 (patch)
treefe7c21c9e75b2cfbb3d4c95eb04ccf56bae38ce7 /src/gui/painting/qdrawhelper_p.h
parent123ae472e2668a1f57f7c69a1a2a59336f83d06a (diff)
Avoid out of bounds memory reads when scaling images
The calculation of the width/height required for the scaling algorithm was prone to floating point rounding issues, where the lower value got rounded down, the higher one rounded up. This could lead to a situation where we iterated over one more line/pixel in the line than we have in the source image. Correct this by passing the dimension of the source image into the function and bounds checking the values before iterating. Task-number: QTBUG-35927 Change-Id: If44b2235a479224660d508a0504fec40d724763a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/painting/qdrawhelper_p.h')
-rw-r--r--src/gui/painting/qdrawhelper_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index bbeb73f0af..1c05fc305a 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -138,7 +138,7 @@ typedef void (*SrcOverBlendFunc)(uchar *destPixels, int dbpl,
int const_alpha);
typedef void (*SrcOverScaleFunc)(uchar *destPixels, int dbpl,
- const uchar *src, int spbl,
+ const uchar *src, int spbl, int srch,
const QRectF &targetRect,
const QRectF &sourceRect,
const QRect &clipRect,