summaryrefslogtreecommitdiff
path: root/glamor/glamor_points.c
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2017-03-14 15:06:34 +0100
committerAdam Jackson <ajax@redhat.com>2017-03-15 15:41:13 -0400
commit455051a0f1d2bc84f605c325f647bd64d414c47d (patch)
treea63428fd4acd94c8341192e6b7f43deaa385c6b3 /glamor/glamor_points.c
parent04b4bad7c048fd077fe839f10634c99ef1e488af (diff)
glamor: Check glamor_set_destination_drawable() return value
Check the value returned by glamor_set_destination_drawable() and use the fallback code path where possible. Bugzilla: https://bugzilla.redhat.com/1417575 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Diffstat (limited to 'glamor/glamor_points.c')
-rw-r--r--glamor/glamor_points.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/glamor/glamor_points.c b/glamor/glamor_points.c
index facfe8240..faf6f433b 100644
--- a/glamor/glamor_points.c
+++ b/glamor/glamor_points.c
@@ -47,6 +47,7 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint
GLshort *vbo_ppt;
char *vbo_offset;
int box_index;
+ Bool ret = FALSE;
pixmap_priv = glamor_get_pixmap_private(pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
@@ -90,8 +91,9 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint
int nbox = RegionNumRects(gc->pCompositeClip);
BoxPtr box = RegionRects(gc->pCompositeClip);
- glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE,
- prog->matrix_uniform, &off_x, &off_y);
+ if (!glamor_set_destination_drawable(drawable, box_index, TRUE, TRUE,
+ prog->matrix_uniform, &off_x, &off_y))
+ goto bail;
while (nbox--) {
glScissor(box->x1 + off_x,
@@ -103,13 +105,13 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint
}
}
+ ret = TRUE;
+
+bail:
glDisable(GL_SCISSOR_TEST);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
- return TRUE;
-
-bail:
- return FALSE;
+ return ret;
}
void