summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@digia.com>2013-11-21 17:22:21 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-22 07:37:13 +0100
commit8d3a15280a63d88341115933d4e8a3a2074d51c6 (patch)
tree09cc9b8c9746df21790f7b74a06f336e02c193fe
parent0224bf8f12293cc24f76649fb4881b93d1353373 (diff)
Detach image data when returning an ImageFrame as a native image.
With error analysis and fixing guidance by Allan Sandfeld Jensen. This caused crashes when a gif was being loaded and the data in the backing store for image frame was prematurely freed. Task-number: QTBUG-31936 Change-Id: I7f4454db00cbbcf53f18060aa986a843c7522d57 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index a3f44650f..2917815bd 100644
--- a/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -274,7 +274,7 @@ PassNativeImagePtr ImageFrame::asNewNativeImage() const
QImage img(reinterpret_cast<uchar*>(m_bytes), m_size.width(), m_size.height(), sizeof(PixelData) * m_size.width(), format);
- return new QPixmap(QPixmap::fromImage(img));
+ return new QPixmap(QPixmap::fromImage(img).copy());
}
}