diff options
author | Juha Turunen <turunen@iki.fi> | 2015-12-08 00:51:54 -0800 |
---|---|---|
committer | Juha Turunen <juha.turunen@theqtcompany.com> | 2015-12-11 17:58:21 +0000 |
commit | 672f7dfdcd00d124cd0f973e04e3e2d6445d5483 (patch) | |
tree | 9d548532b7ee7a51f199cab03486873c11c41d84 /src/gui/opengl | |
parent | 6e14d63db023fdad223d9dc35b0e1ba31aac997d (diff) |
Fix a crash when calling QOpenGLTexture::setData with a null QImage.
Change-Id: Idf8ae00cff6929114b38dcb003c259c83a11dbaa
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r-- | src/gui/opengl/qopengltexture.cpp | 6 |
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 |