From 1e6f46eb0c959c493a7f25f0dd3be42d38382041 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 28 Sep 2023 12:59:53 +0200 Subject: [PATCH] scene/imageitem: don't crash if uploading a texture fails BUG: 474952 --- src/scene/imageitem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scene/imageitem.cpp b/src/scene/imageitem.cpp index b4a6ce2117..4cdb42926e 100644 --- a/src/scene/imageitem.cpp +++ b/src/scene/imageitem.cpp @@ -50,6 +50,9 @@ void ImageItemOpenGL::preprocess() if (!m_texture || m_texture->size() != m_image.size()) { m_texture = GLTexture::upload(m_image); + if (!m_texture) { + return; + } m_texture->setFilter(GL_LINEAR); m_texture->setWrapMode(GL_CLAMP_TO_EDGE); } else {