summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qtextureglyphcache.cpp
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/gui/painting/qtextureglyphcache.cpp
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/gui/painting/qtextureglyphcache.cpp')
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 91214f27ca..e906397520 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -350,7 +350,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP
int mw = qMin(mask.width(), c.w);
int mh = qMin(mask.height(), c.h);
uchar *d = m_image.bits();
- int dbpl = m_image.bytesPerLine();
+ qsizetype dbpl = m_image.bytesPerLine();
for (int y = 0; y < c.h; ++y) {
uchar *dest = d + (c.y + y) *dbpl + c.x/8;
@@ -372,7 +372,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP
int mw = qMin(mask.width(), c.w);
int mh = qMin(mask.height(), c.h);
uchar *d = m_image.bits();
- int dbpl = m_image.bytesPerLine();
+ qsizetype dbpl = m_image.bytesPerLine();
if (mask.depth() == 1) {
for (int y = 0; y < c.h; ++y) {