From 62c983032b723ab22111c6d7e535cf7106ede800 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 7 May 2016 05:31:22 +0000 Subject: [PATCH] use d->height directly in QImage when d is already checked some of the changes are my own upstream commits: https://github.com/qtproject/qtbase/commit/2e8bec9e4b8d229ad9f5f73d2362f21c13599816 Signed-off-by: Ivailo Monev --- src/gui/image/qimage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index ac4dd4905..55d1603e1 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -3649,7 +3649,7 @@ bool QImage::valid(int x, int y) const */ int QImage::pixelIndex(int x, int y) const { - if (!d || x < 0 || x >= d->width || y < 0 || y >= height()) { + if (!d || x < 0 || x >= d->width || y < 0 || y >= d->height) { qWarning("QImage::pixelIndex: coordinate (%d,%d) out of range", x, y); return -12345; } @@ -3689,7 +3689,7 @@ int QImage::pixelIndex(int x, int y) const */ QRgb QImage::pixel(int x, int y) const { - if (!d || x < 0 || x >= d->width || y < 0 || y >= height()) { + if (!d || x < 0 || x >= d->width || y < 0 || y >= d->height) { qWarning("QImage::pixel: coordinate (%d,%d) out of range", x, y); return 12345; } -- 2.11.0