summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@theqtcompany.com>2015-02-25 15:39:41 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-26 01:27:37 +0000
commit68762151dbf45fbb44e140ac2ad13dbe8d357352 (patch)
treed0c753d15d9ebc44db5a7f12013f82f4f27d4e69 /src/gui/image
parenta659b4e56be9721389d28e212b4f4bcd393e6410 (diff)
Fix crash when converting format of QImage created from buffer
When doing format conversion, the optimized inplace codepath did not check if the image data was readonly, i.e. if the QImage had been created by the constructor taking an existing external buffer. Task-number: QTBUG-44610 Change-Id: I085ff8da427bc4ee392f548dffd2418b63148965 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qimage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 887a7c29eb..6699e516a0 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4565,7 +4565,7 @@ bool QImageData::convertInPlace(QImage::Format newFormat, Qt::ImageConversionFla
return true;
// No in-place conversion if we have to detach
- if (ref.load() > 1)
+ if (ref.load() > 1 || ro_data)
return false;
const InPlace_Image_Converter *const converterPtr = &qimage_inplace_converter_map[format][newFormat];