summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWater-Team <water@pad.test.qt.nokia.com>2011-07-25 23:00:11 (GMT)
committerWater-Team <water@pad.test.qt.nokia.com>2011-07-25 23:00:11 (GMT)
commita9f3783e9402354f7211c9c293627b34f1080251 (patch)
tree902d72180b3bb4235123b67f094148b61d8cf63b /src
parent981d8f6c95e9c7a21c800ce20e63221b89a20ed1 (diff)
parent9d5f03fceb43946b4db0731f66c2f27c01d3cd6f (diff)
downloadQt-a9f3783e9402354f7211c9c293627b34f1080251.zip
Qt-a9f3783e9402354f7211c9c293627b34f1080251.tar.gz
Qt-a9f3783e9402354f7211c9c293627b34f1080251.tar.bz2
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qtiffhandler.cpp13
-rw-r--r--src/opengl/qpixmapdata_symbiangl.cpp3
2 files changed, 10 insertions, 6 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 7811110..a7e33e2 100644
--- a/src/opengl/qpixmapdata_symbiangl.cpp
+++ b/src/opengl/qpixmapdata_symbiangl.cpp
@@ -670,7 +670,7 @@ static inline bool knownGoodFormat(QImage::Format format)
}
}
-#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL)
+#ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE
static inline int symbianPixeFormatBitsPerPixel(TUidPixelFormat pixelFormat)
{
switch (pixelFormat) {
@@ -723,6 +723,7 @@ static inline int symbianPixeFormatBitsPerPixel(TUidPixelFormat pixelFormat)
};
}
#endif
+
void QGLPixmapData::fromNativeType(void* pixmap, NativeType type)
{
if (type == QPixmapData::SgImage && pixmap) {