summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-06-24 11:07:45 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-06-24 11:20:36 (GMT)
commit20a3d8c889df2338f6edd209ca4952b9045ffb00 (patch)
tree8797ab492187008fed50835dfb788653c246a920 /tests
parent6f006b105978f53b7c5bd3d17637239f308ad20d (diff)
downloadQt-20a3d8c889df2338f6edd209ca4952b9045ffb00.zip
Qt-20a3d8c889df2338f6edd209ca4952b9045ffb00.tar.gz
Qt-20a3d8c889df2338f6edd209ca4952b9045ffb00.tar.bz2
Fixed some potential index-out-of-bounds issues in QImage.
Added color table bounds checks when converting a color indexed image to a different pixel format. Fixed an off-by-one error in the color table bounds check in QImage::setPixel(). Fixed an autotest that was setting pixel values out of bounds. Reviewed-by: Gunnar
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qimage/tst_qimage.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index 16deb03..5052114 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -945,11 +945,11 @@ void tst_QImage::rotate()
const int n = original.colorTable().size();
for (int x = 0; x < w; ++x) {
original.setPixel(x, 0, x % n);
- original.setPixel(x,h - 1, n - (x % n));
+ original.setPixel(x, h - 1, n - (x % n) - 1);
}
for (int y = 0; y < h; ++y) {
original.setPixel(0, y, y % n);
- original.setPixel(w - 1, y, n - (y % n));
+ original.setPixel(w - 1, y, n - (y % n) - 1);
}
}