glamor: avoid null dereference in glamor_composite_clipped_region()

Reported in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817:

xwayland-24.1.6/redhat-linux-build/../glamor/glamor_render.c:1577:21:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2094>
This commit is contained in:
Alan Coopersmith
2025-11-25 00:52:37 +02:00
committed by Enrico Weigelt
parent 5d7ec3493c
commit 4db6ede54d

View File

@@ -1584,7 +1584,7 @@ glamor_composite_clipped_region(CARD8 op,
if (source
&& ((!source->pDrawable
&& (source->pSourcePict->type != SourcePictTypeSolidFill))
|| (source->pDrawable
|| (source->pDrawable && source_pixmap
&& !GLAMOR_PIXMAP_PRIV_HAS_FBO(source_pixmap_priv)
&& (source_pixmap->drawable.width != width
|| source_pixmap->drawable.height != height)))) {