no VBO upload for zero vertex count

causes out of bounds segfault

BUG: 347900
REVIEW: 123865
FIXED-IN: 5.3.1
This commit is contained in:
Thomas Lübking 2015-05-19 14:35:12 +02:00
parent 00dd1ad0fa
commit 12358f839a
2 changed files with 4 additions and 0 deletions

View file

@ -230,6 +230,8 @@ void ContrastEffect::uploadRegion(QVector2D *&map, const QRegion &region)
void ContrastEffect::uploadGeometry(GLVertexBuffer *vbo, const QRegion &region)
{
const int vertexCount = region.rectCount() * 6;
if (!vertexCount)
return;
QVector2D *map = (QVector2D *) vbo->map(vertexCount * sizeof(QVector2D));
uploadRegion(map, region);

View file

@ -236,6 +236,8 @@ void BlurEffect::uploadRegion(QVector2D *&map, const QRegion &region)
void BlurEffect::uploadGeometry(GLVertexBuffer *vbo, const QRegion &horizontal, const QRegion &vertical)
{
const int vertexCount = (horizontal.rectCount() + vertical.rectCount()) * 6;
if (!vertexCount)
return;
QVector2D *map = (QVector2D *) vbo->map(vertexCount * sizeof(QVector2D));
uploadRegion(map, horizontal);