From b9df6ed8a2eef2ac1cc495aadf07100b66f48ebe Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 16 Apr 2025 18:15:40 +0200 Subject: [PATCH] Xv: fix segfault on shutdown Protect against adaptor having NULL port list in XvStopAdaptors() Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/xvmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xext/xvmain.c b/Xext/xvmain.c index 818452998..88bf98ff3 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -351,7 +351,7 @@ XvStopAdaptors(DrawablePtr pDrawable) XvPortPtr pp = pa->pPorts; int np = pa->nPorts; - while (np--) { + while ((np--) && (pp)) { if (pp->pDraw == pDrawable) { XvdiSendVideoNotify(pp, pDrawable, XvPreempted);