diff options
Diffstat (limited to 'src/gui/image/qpixmap_mac.cpp')
-rw-r--r-- | src/gui/image/qpixmap_mac.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index ca9d497..b40694a 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -168,7 +168,7 @@ static inline QRgb qt_conv16ToRgb(ushort c) { QSet<QMacPixmapData*> QMacPixmapData::validDataPointers; QMacPixmapData::QMacPixmapData(PixelType type) - : QPixmapData(type, MacClass), w(0), h(0), d(0), has_alpha(0), has_mask(0), + : QPixmapData(type, MacClass), has_alpha(0), has_mask(0), uninit(true), pixels(0), pixelsToFree(0), bytesPerRow(0), cg_data(0), cg_dataBeingReleased(0), cg_mask(0), #ifndef QT_MAC_NO_QUICKDRAW @@ -188,11 +188,13 @@ void QMacPixmapData::resize(int width, int height) w = width; h = height; + is_null = (w <= 0 || h <= 0); d = (pixelType() == BitmapType ? 1 : 32); bool make_null = w <= 0 || h <= 0; // create null pixmap if (make_null || d == 0) { w = 0; h = 0; + is_null = true; d = 0; if (!make_null) qWarning("Qt: QPixmap: Invalid pixmap parameters"); @@ -231,6 +233,7 @@ void QMacPixmapData::fromImage(const QImage &img, w = img.width(); h = img.height(); + is_null = (w <= 0 || h <= 0); d = (pixelType() == BitmapType ? 1 : img.depth()); QImage image = img; |