summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qmovie.cpp2
-rw-r--r--src/gui/image/qpicture.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp
index 2ff9fb4e36..d5e8b1b974 100644
--- a/src/gui/image/qmovie.cpp
+++ b/src/gui/image/qmovie.cpp
@@ -1017,7 +1017,7 @@ QList<QByteArray> QMovie::supportedFormats()
const auto doesntSupportAnimation =
[&buffer](const QByteArray &format) {
- return !QImageReader(&buffer, format).supportsAnimation();
+ return !QImageReader(&buffer, format).supportsOption(QImageIOHandler::Animation);
};
list.erase(std::remove_if(list.begin(), list.end(), doesntSupportAnimation), list.end());
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index f2c5e250e1..bf628e7571 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -1207,7 +1207,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;
}
/*!