diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 54fd63e50..5165417f7 100644 --- a/fb/fboverlay.c +++ b/fb/fboverlay.c @@ -24,6 +24,7 @@ #include +#include #include #include "include/shmint.h" @@ -210,6 +211,7 @@ fbOverlayCopyWindow(WindowPtr pWin, xPoint ptOldOrg, RegionPtr prgnSrc) /* * Compute the portion of each fb affected by this copy */ + assert(pScrPriv->nlayers <= FB_OVERLAY_MAX); for (i = 0; i < pScrPriv->nlayers; i++) { RegionNull(&layerRgn[i]); RegionIntersect(&layerRgn[i], &rgnDst,