diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/opengl/qopengltexturecache.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp index 4806a9d5ff..a93ae91354 100644 --- a/src/gui/opengl/qopengltexturecache.cpp +++ b/src/gui/opengl/qopengltexturecache.cpp @@ -107,6 +107,8 @@ QOpenGLTextureCache::~QOpenGLTextureCache() GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QPixmap &pixmap) { + if (pixmap.isNull()) + return 0; QMutexLocker locker(&m_mutex); qint64 key = pixmap.cacheKey(); @@ -128,6 +130,8 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QPixmap & GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &image) { + if (image.isNull()) + return 0; QMutexLocker locker(&m_mutex); qint64 key = image.cacheKey(); |