diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2017-07-26 16:00:37 +0200 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-09-13 11:02:48 -0400 |
commit | bd353e9b84e013fc34ed730319d5b63d20977903 (patch) | |
tree | d1003753cec89aeed45e5f40db95a0dd457dabe8 | |
parent | 4486d199bd3bcb5b2b8ad9bc54eb11604d9bd653 (diff) |
glamor: handle NULL source picture
COMPOSITE_REGION() can pass NULL as a source picture, make sure we
handle that nicely in both glamor_composite_clipped_region() and
glamor_composite_choose_shader().
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101894
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
-rw-r--r-- | glamor/glamor_render.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c index 3f982a2d2..3e126f0f2 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -992,7 +992,7 @@ glamor_composite_choose_shader(CARD8 op, goto fail; } } else { - if (!glamor_render_format_is_supported(source->format)) { + if (source && !glamor_render_format_is_supported(source->format)) { glamor_fallback("Unsupported source picture format.\n"); goto fail; } @@ -1436,7 +1436,8 @@ glamor_composite_clipped_region(CARD8 op, x_source, y_source, x_mask, y_mask, x_dest, y_dest, width, height); /* Is the composite operation equivalent to a copy? */ - if (!mask && !source->alphaMap && !dest->alphaMap + if (source && + !mask && !source->alphaMap && !dest->alphaMap && source->pDrawable && !source->transform /* CopyArea is only defined with matching depths. */ && dest->pDrawable->depth == source->pDrawable->depth |