summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage_conversions.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-03-31 10:03:31 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-03-31 10:03:31 +0200
commitce9519593a0b3deb99d1dd2529770f7e9fffef92 (patch)
treec9bca05230dd68f49494240ae930bad1fe0c5956 /src/gui/image/qimage_conversions.cpp
parent509f77cca28aa3edea5523c5869bae4412ed2ccc (diff)
parent7baaec17edb06634f1d6235a55c7adbd112cba3e (diff)
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
Diffstat (limited to 'src/gui/image/qimage_conversions.cpp')
-rw-r--r--src/gui/image/qimage_conversions.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp
index 417c185c78..28e3a48689 100644
--- a/src/gui/image/qimage_conversions.cpp
+++ b/src/gui/image/qimage_conversions.cpp
@@ -681,6 +681,8 @@ static bool convert_BGR30_to_RGB30_inplace(QImageData *data, Qt::ImageConversion
static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConversionFlags)
{
Q_ASSERT(data->format == QImage::Format_Indexed8);
+ if (!data->own_data)
+ return false;
const int depth = 32;
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
@@ -733,6 +735,8 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve
static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversionFlags)
{
Q_ASSERT(data->format == QImage::Format_Indexed8);
+ if (!data->own_data)
+ return false;
const int depth = 32;
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
@@ -782,6 +786,8 @@ static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversio
static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFlags)
{
Q_ASSERT(data->format == QImage::Format_Indexed8);
+ if (!data->own_data)
+ return false;
const int depth = 16;
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;
@@ -837,6 +843,8 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers
static bool convert_RGB_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFlags)
{
Q_ASSERT(data->format == QImage::Format_RGB32);
+ if (!data->own_data)
+ return false;
const int depth = 16;
const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;