diff options
author | Connor Behan <connor.behan@gmail.com> | 2015-08-24 13:48:29 -0400 |
---|---|---|
committer | Connor Behan <connor.behan@gmail.com> | 2015-08-24 13:48:29 -0400 |
commit | f1e6c73be073c8816319104b2fde329bc286f5ec (patch) | |
tree | 3cd29ba515b342efa0bce7235fae6f569f3a8714 /src/mga_exa.c | |
parent | e6770f7cc11800ab6cc2e88790f357189de7ce32 (diff) |
Composite fixup
A driver like this that tries to composite a lot will definitely need to
avoid crashing for solid pictures.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Diffstat (limited to 'src/mga_exa.c')
-rw-r--r-- | src/mga_exa.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mga_exa.c b/src/mga_exa.c index a011c91..c4e4d90 100644 --- a/src/mga_exa.c +++ b/src/mga_exa.c @@ -318,6 +318,11 @@ mgaGetTexFormat(PicturePtr pPict) static Bool mgaCheckSourceTexture(int tmu, PicturePtr pPict) { + if (!pPict->pDrawable) { + DEBUG_MSG(("Solid / gradient pictures not supported\n")); + return FALSE; + } + int w = pPict->pDrawable->width; int h = pPict->pDrawable->height; @@ -354,7 +359,7 @@ static Bool mgaCheckComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict, PicturePtr pDstPict) { - MGAPtr pMga = xf86ScreenToScrn(pSrcPict->pDrawable->pScreen)->driverPrivate; + MGAPtr pMga = xf86ScreenToScrn(pDstPict->pDrawable->pScreen)->driverPrivate; if (op >= sizeof(mgaBlendOp) / sizeof(mgaBlendOp[0])) { DEBUG_MSG(("unsupported op %x\n", op)); @@ -521,6 +526,7 @@ mgaPrepareComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict, { PMGA(pDst); CARD32 fcol = 0xff000000, ds0 = 0, ds1 = 0, cmd, blendcntl; + if (!pSrc || !pSrcPict->pDrawable) return FALSE; mgaSetup(pMga, pDst, pDstPict, 2); OUTREG(MGAREG_DSTORG, exaGetPixmapOffset(pDst)); |