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:
parent
00dd1ad0fa
commit
12358f839a
2 changed files with 4 additions and 0 deletions
|
@ -230,6 +230,8 @@ void ContrastEffect::uploadRegion(QVector2D *&map, const QRegion ®ion)
|
|||
void ContrastEffect::uploadGeometry(GLVertexBuffer *vbo, const QRegion ®ion)
|
||||
{
|
||||
const int vertexCount = region.rectCount() * 6;
|
||||
if (!vertexCount)
|
||||
return;
|
||||
|
||||
QVector2D *map = (QVector2D *) vbo->map(vertexCount * sizeof(QVector2D));
|
||||
uploadRegion(map, region);
|
||||
|
|
|
@ -236,6 +236,8 @@ void BlurEffect::uploadRegion(QVector2D *&map, const QRegion ®ion)
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue