summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qmacstyle_mac.mm
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-07-08 14:10:34 +0200
committerTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-07-14 11:03:14 +0000
commitd7cb2fd44b7801799401dca343014bbf53ad130c (patch)
tree79c5bf18cf7be63358532f9902f885e68ea2a299 /src/widgets/styles/qmacstyle_mac.mm
parent21c8a66a152e3184d8f965dc4cf2a1bee234780d (diff)
QMacStyle::styleHint - test pixmap sizes
styleHint for SH_FocusFrame_Mask calls drawControl with a painter created for pixmap. We only test pixmapSize.isValid(), but the size (0,0) is also 'isValid', and we end up with a QPainter with an invalid paintEngine (null) crashing in drawControl. Task-number: QTBUG-54630 Change-Id: I84d1785f04ffb3e608812076a6d1bc36ffb92adc Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'src/widgets/styles/qmacstyle_mac.mm')
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 18ba2f45f5..3352c5d589 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -2961,7 +2961,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
QImage img;
QSize pixmapSize = opt->rect.size();
- if (pixmapSize.isValid()) {
+ if (!pixmapSize.isEmpty()) {
QPixmap pix(pixmapSize);
pix.fill(QColor(fillR, fillG, fillB));
QPainter pix_paint(&pix);