Xv: fix segfault on shutdown

Protect against adaptor having NULL port list in XvStopAdaptors()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-04-16 18:15:40 +02:00
parent 96523e64f3
commit b9df6ed8a2

View File

@ -351,7 +351,7 @@ XvStopAdaptors(DrawablePtr pDrawable)
XvPortPtr pp = pa->pPorts; XvPortPtr pp = pa->pPorts;
int np = pa->nPorts; int np = pa->nPorts;
while (np--) { while ((np--) && (pp)) {
if (pp->pDraw == pDrawable) { if (pp->pDraw == pDrawable) {
XvdiSendVideoNotify(pp, pDrawable, XvPreempted); XvdiSendVideoNotify(pp, pDrawable, XvPreempted);