summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@digia.com>2014-01-29 10:07:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-30 13:13:53 +0100
commit848c5d01e2ed63f8d8b853db028da4484a1d2e2a (patch)
tree2928b436a2d9d0c100727cc88c0f2a8a46b8ecde
parente4588b70dde3fe5ba8f77a0b749ec1b071346767 (diff)
Fixed assert in blend_transformed_tiled_argb
px16 and py16 might be <0 in the first iteration of the loop. In order to avoid accessing an invalid index the values have to be corrected before px and py are accessed. Change-Id: I790faeacc2b77ae8af52bf5e69a2d801c9fe973d Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
-rw-r--r--src/gui/painting/qdrawhelper.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 39193dd093..813454fe8b 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -5145,6 +5145,8 @@ static void blend_transformed_tiled_argb(int count, const QSpan *spans, void *us
int px_delta = fdx % (image_width << 16);
int py_delta = fdy % (image_height << 16);
while (b < end) {
+ if (px16 < 0) px16 += image_width << 16;
+ if (py16 < 0) py16 += image_height << 16;
int px = px16 >> 16;
int py = py16 >> 16;
int y_offset = py * scanline_offset;
@@ -5161,8 +5163,6 @@ static void blend_transformed_tiled_argb(int count, const QSpan *spans, void *us
py16 += py_delta;
if (py16 >= image_height << 16)
py16 -= image_height << 16;
- if (px16 < 0) px16 += image_width << 16;
- if (py16 < 0) py16 += image_height << 16;
++b;
}
func(target, buffer, l, coverage);