diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 56f24d756..cfa1ae3e6 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1714,7 +1714,8 @@ DamageCreate(DamageReportFunc damageReport, pDamage->damageDestroy = damageDestroy; pDamage->pScreen = pScreen; - (*pScrPriv->funcs.Create) (pDamage); + if (pScrPriv && pScrPriv->funcs.Create) + pScrPriv->funcs.Create(pDamage); return pDamage; } @@ -1755,7 +1756,8 @@ DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage) pDamage->isWindow = FALSE; pDamage->pDrawable = pDrawable; damageInsertDamage(getDrawableDamageRef(pDrawable), pDamage); - (*pScrPriv->funcs.Register) (pDrawable, pDamage); + if (pScrPriv && pScrPriv->funcs.Register) + pScrPriv->funcs.Register(pDrawable, pDamage); } void @@ -1774,7 +1776,10 @@ DamageUnregister(DamagePtr pDamage) damageScrPriv(pScreen); - (*pScrPriv->funcs.Unregister) (pDrawable, pDamage); + if (pScrPriv && pScrPriv->funcs.Unregister) + pScrPriv->funcs.Unregister(pDrawable, pDamage); + else + miDamageUnregister(pDrawable, pDamage); if (pDrawable->type == DRAWABLE_WINDOW) { WindowPtr pWindow = (WindowPtr) pDrawable; @@ -1817,7 +1822,9 @@ DamageDestroy(DamagePtr pDamage) if (pDamage->damageDestroy) (*pDamage->damageDestroy) (pDamage, pDamage->closure); - (*pScrPriv->funcs.Destroy) (pDamage); + + if (pScrPriv && pScrPriv->funcs.Destroy) + pScrPriv->funcs.Destroy(pDamage); RegionUninit(&pDamage->damage); RegionUninit(&pDamage->pendingDamage); free(pDamage);