diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2017-03-14 15:06:34 +0100 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2017-09-21 15:00:21 +0200 |
commit | 9db3361b29396684122b3db056368e927e8de6d6 (patch) | |
tree | 6889e834a7211c40dfa7ccd038815e91b185938b /glamor/glamor_lines.c | |
parent | 703ba42ce658faadb3d8ad32ea03fa9c9f0c91b1 (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>
(cherry picked from commit 455051a0f1d2bc84f605c325f647bd64d414c47d)
Diffstat (limited to 'glamor/glamor_lines.c')
-rw-r--r-- | glamor/glamor_lines.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/glamor/glamor_lines.c b/glamor/glamor_lines.c index a2c9b1fcc..5d95333fe 100644 --- a/glamor/glamor_lines.c +++ b/glamor/glamor_lines.c @@ -46,6 +46,7 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, char *vbo_offset; int box_index; int add_last; + Bool ret = FALSE; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) @@ -103,8 +104,9 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, 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, @@ -116,12 +118,13 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, } } + ret = TRUE; + +bail: glDisable(GL_SCISSOR_TEST); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - return TRUE; -bail: - return FALSE; + return ret; } static Bool |