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);