summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qpicture.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 7506e2e1a9..010f5ecf67 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -1206,7 +1206,12 @@ QT_END_INCLUDE_NAMESPACE
const char* QPicture::pictureFormat(const QString &fileName)
{
- return QPictureIO::pictureFormat(fileName);
+ const QByteArray format = QPictureIO::pictureFormat(fileName);
+ // This function returns a const char * from a QByteArray.
+ // Double check that the QByteArray is not detached, otherwise
+ // we would return a dangling pointer.
+ Q_ASSERT(!format.isDetached());
+ return format;
}
/*!