shortcut rendering textures for empty an rect

it makes no sense and there's a good chance
that in this case m_vbo is still nullptr and
it will not be created since d->m_cachedSize
will be an empty size as well
-> nullptr access -> crash

BUG: 337090
FIXED-IN: 5.2
This commit is contained in:
Thomas Lübking 2015-01-08 00:25:46 +01:00
parent 8de4e4d84e
commit f61d3ade84

View file

@ -447,6 +447,8 @@ void GLTexture::unbind()
void GLTexture::render(QRegion region, const QRect& rect, bool hardwareClipping)
{
Q_D(GLTexture);
if (rect.isEmpty())
return; // nothing to paint and m_vbo is likely nullptr and d->m_cachedSize empty as well, #337090
if (rect.size() != d->m_cachedSize) {
d->m_cachedSize = rect.size();
QRect r(rect);