Don't crash when source or target is null
Change-Id: I4992867ad764bd1bd175478c6be1094ca8a72812 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
parent
65733af6aa
commit
3fe3d1dfdd
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user