diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-11-02 22:23:18 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-11-02 22:23:18 (GMT) |
commit | b72d41cf30f82c74c10c31808907cc990c86efe6 (patch) | |
tree | 502ec3abe99a1efaa3c91f1c81bf67104198ccc1 /src/openvg/qpixmapdata_vg.cpp | |
parent | c7386b14e0c9844db91ca0d2ae6bded6efa008aa (diff) | |
download | Qt-b72d41cf30f82c74c10c31808907cc990c86efe6.zip Qt-b72d41cf30f82c74c10c31808907cc990c86efe6.tar.gz Qt-b72d41cf30f82c74c10c31808907cc990c86efe6.tar.bz2 |
Protect the OpenVG engine from null QPixmapData objects
Reviewed-by: Sarah Smith
Diffstat (limited to 'src/openvg/qpixmapdata_vg.cpp')
-rw-r--r-- | src/openvg/qpixmapdata_vg.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index f86e116..3254aa3 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -369,6 +369,8 @@ QImage::Format QVGPixmapData::sourceFormat() const Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap& pixmap) { QPixmapData *pd = pixmap.pixmapData(); + if (!pd) + return VG_INVALID_HANDLE; // null QPixmap if (pd->classId() == QPixmapData::OpenVGClass) { QVGPixmapData *vgpd = static_cast<QVGPixmapData *>(pd); if (vgpd->isValid()) |