diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-07-22 08:38:28 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-07-22 08:38:28 (GMT) |
commit | a0da99611734651f8ad4de3090f7ab05c2b2f9c1 (patch) | |
tree | fe8b387b4de7757e97d2a27e2e1568470a3fca9f | |
parent | b8327a0d5c5192750f7bf959290f6a50cdcb85b5 (diff) | |
parent | 32763b898ad96cc0906aaf3406325134b849a284 (diff) | |
download | Qt-a0da99611734651f8ad4de3090f7ab05c2b2f9c1.zip Qt-a0da99611734651f8ad4de3090f7ab05c2b2f9c1.tar.gz Qt-a0da99611734651f8ad4de3090f7ab05c2b2f9c1.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts:
src/gui/image/qtiffhandler.cpp
-rw-r--r-- | src/gui/image/qtiffhandler.cpp | 13 | ||||
-rw-r--r-- | src/opengl/qpixmapdata_symbiangl.cpp | 4 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/gui/image/qtiffhandler.cpp b/src/gui/image/qtiffhandler.cpp index c753b83..4dc9775 100644 --- a/src/gui/image/qtiffhandler.cpp +++ b/src/gui/image/qtiffhandler.cpp @@ -236,14 +236,14 @@ bool QTiffHandler::read(QImage *image) } } else { // create the color table - uint16 *redTable = static_cast<uint16 *>(qMalloc(tableSize * sizeof(uint16))); - uint16 *greenTable = static_cast<uint16 *>(qMalloc(tableSize * sizeof(uint16))); - uint16 *blueTable = static_cast<uint16 *>(qMalloc(tableSize * sizeof(uint16))); - if (!redTable || !greenTable || !blueTable) { + uint16 *redTable = 0; + uint16 *greenTable = 0; + uint16 *blueTable = 0; + if (!TIFFGetField(tiff, TIFFTAG_COLORMAP, &redTable, &greenTable, &blueTable)) { TIFFClose(tiff); return false; } - if (!TIFFGetField(tiff, TIFFTAG_COLORMAP, &redTable, &greenTable, &blueTable)) { + if (!redTable || !greenTable || !blueTable) { TIFFClose(tiff); return false; } @@ -500,6 +500,9 @@ bool QTiffHandler::write(const QImage &image) uint16 *greenTable = static_cast<uint16 *>(qMalloc(256 * sizeof(uint16))); uint16 *blueTable = static_cast<uint16 *>(qMalloc(256 * sizeof(uint16))); if (!redTable || !greenTable || !blueTable) { + qFree(redTable); + qFree(greenTable); + qFree(blueTable); TIFFClose(tiff); return false; } diff --git a/src/opengl/qpixmapdata_symbiangl.cpp b/src/opengl/qpixmapdata_symbiangl.cpp index 78e5ee7..a7e33e2 100644 --- a/src/opengl/qpixmapdata_symbiangl.cpp +++ b/src/opengl/qpixmapdata_symbiangl.cpp @@ -142,6 +142,7 @@ QGLPixmapData::QGLPixmapData(PixelType type) QGLPixmapData::~QGLPixmapData() { +#ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE if (m_sgImage) { if (m_texture.id) { QGLSgImageTextureCleanup::cleanupForContext(m_ctx)->remove(m_texture.id); @@ -152,6 +153,7 @@ QGLPixmapData::~QGLPixmapData() delete m_sgImage; m_sgImage = 0; } +#endif delete m_engine; } @@ -668,6 +670,7 @@ static inline bool knownGoodFormat(QImage::Format format) } } +#ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE static inline int symbianPixeFormatBitsPerPixel(TUidPixelFormat pixelFormat) { switch (pixelFormat) { @@ -719,6 +722,7 @@ static inline int symbianPixeFormatBitsPerPixel(TUidPixelFormat pixelFormat) return 32; }; } +#endif void QGLPixmapData::fromNativeType(void* pixmap, NativeType type) { |