summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/opengl/qopengltexture.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index 5271826015..c58ddbd71e 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -3050,6 +3050,12 @@ void QOpenGLTexture::setData(const QImage& image, MipMapGeneration genMipMaps)
qWarning("QOpenGLTexture::setData() requires a valid current context");
return;
}
+
+ if (image.isNull()) {
+ qWarning("QOpenGLTexture::setData() tried to set a null image");
+ return;
+ }
+
if (context->isOpenGLES() && context->format().majorVersion() < 3)
setFormat(QOpenGLTexture::RGBAFormat);
else