From 390a8c36f7a59db4c3fe92d0c28ef084ebb92954 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Tue, 20 May 2014 15:04:35 +0900 Subject: [PATCH] Fix a crash in QOpenGLTexture::allocateStorage() QOpenGLTexture texture(QOpenGLTexture::Target2D); texture.allocateStorage(); // crashed Change-Id: Ia12f69b72e537cf765387cd172d7cb2cbbbad6e6 Reviewed-by: Gunnar Sletta Reviewed-by: Sean Harmer --- src/gui/opengl/qopengltexture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index e3444332a0..6b6d4bcf41 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -2081,7 +2081,9 @@ int QOpenGLTexture::faces() const void QOpenGLTexture::allocateStorage() { Q_D(QOpenGLTexture); - d->allocateStorage(); + if (d->create()) { + d->allocateStorage(); + } } /*!