summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-13 11:31:14 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-02-20 16:11:02 +0100
commit14f1ec186f87ce50037044ccb079463676518ec5 (patch)
tree7e0918d1889cc93d52c5e996e79a733b2728e37b /src/platformsupport
parenta99d7cf37213f86c8be55fc80a9785ec9a0d382d (diff)
Make bytes-per-line safe for int overflow
Goes through the Qt code and make sure bytes-per-line calculations are safe when they are too big for 32bit integers. Change-Id: I88b2d74b3da82e91407d316aa932a4a37587c0cf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/platformcompositor/qplatformbackingstoreopenglsupport.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platformsupport/platformcompositor/qplatformbackingstoreopenglsupport.cpp b/src/platformsupport/platformcompositor/qplatformbackingstoreopenglsupport.cpp
index ca50910114..511d85a400 100644
--- a/src/platformsupport/platformcompositor/qplatformbackingstoreopenglsupport.cpp
+++ b/src/platformsupport/platformcompositor/qplatformbackingstoreopenglsupport.cpp
@@ -385,7 +385,7 @@ GLuint QPlatformBackingStoreOpenGLSupport::toTexture(const QRegion &dirtyRegion,
// The image provided by the backingstore may have a stride larger than width * 4, for
// instance on platforms that manually implement client-side decorations.
static const int bytesPerPixel = 4;
- const int strideInPixels = image.bytesPerLine() / bytesPerPixel;
+ const qsizetype strideInPixels = image.bytesPerLine() / bytesPerPixel;
const bool hasUnpackRowLength = !ctx->isOpenGLES() || ctx->format().majorVersion() >= 3;
QOpenGLFunctions *funcs = ctx->functions();