summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2012-01-26 11:15:02 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-30 14:43:27 +0100
commit3fe3d1dfdda9be266ba2400a85fd100c4e3d2cc2 (patch)
treed70dc9a8b918c690b876fab88b0b10ccfdbbb5c3 /src/gui
parent65733af6aa0a494a21b6083628cec69dff005ad1 (diff)
Don't crash when source or target is null
Change-Id: I4992867ad764bd1bd175478c6be1094ca8a72812 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 6714ea3d49..5e22554303 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -1142,8 +1142,24 @@ void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target,
QOpenGLFramebufferObject *source,
GLbitfield buffers, GLenum filter)
{
- blitFramebuffer(target, QRect(QPoint(0, 0), target->size()),
- source, QRect(QPoint(0, 0), source->size()),
+ if (!target && !source)
+ return;
+
+ QSize targetSize;
+ QSize sourceSize;
+
+ if (target)
+ targetSize = target->size();
+ if (source)
+ sourceSize = source->size();
+
+ if (targetSize.isEmpty())
+ targetSize = sourceSize;
+ else if (sourceSize.isEmpty())
+ sourceSize = targetSize;
+
+ blitFramebuffer(target, QRect(QPoint(0, 0), targetSize),
+ source, QRect(QPoint(0, 0), sourceSize),
buffers, filter);
}