kwin: bug fix for crash when using the raster backend

It seems to be possible to generate a QPixmap that is not null,
but doesnt have a paintEngine.
This commit is contained in:
Philipp Knechtges 2011-05-19 21:41:30 +02:00
parent 866120ba2c
commit 5577cc769b

View file

@ -341,7 +341,7 @@ bool SceneOpenGL::Texture::load(const QPixmap& pixmap, GLenum target)
return false;
// Checking whether QPixmap comes with its own X11 Pixmap
if (pixmap.paintEngine()->type() != QPaintEngine::X11 || pixmap.handle() == 0) {
if (pixmap.paintEngine() == 0 || pixmap.paintEngine()->type() != QPaintEngine::X11 || pixmap.handle() == 0) {
return GLTexture::load(pixmap.toImage(), target);
}