summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl/qopengltexture.cpp')
-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 02dee5a90a..6b83c17fd4 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -3222,6 +3222,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