xa: fix segfault
authorRob Clark <robclark@freedesktop.org>
Sun, 4 May 2014 14:40:46 +0000 (10:40 -0400)
committerRob Clark <robclark@freedesktop.org>
Sun, 4 May 2014 15:08:10 +0000 (11:08 -0400)
commitb7e7ae9f605283076dba6d9e826fbbd1f1db1c4b
treed15bf50b7ca2c7b18597d146b7d3cbd8898b6e02
parent829cb0423d18331b9ba0b6098e2b312ff2ce6053
xa: fix segfault

Fixes:

  Program received signal SIGSEGV, Segmentation fault.
  bind_samplers (comp=0x21b054, comp=0x21b054, ctx=0x211430)
      at ../../../../../src/gallium/state_trackers/xa/xa_composite.c:445
  445 mask_pic->srf->tex->format);
  (gdb) bt
  #0  bind_samplers (comp=0x21b054, comp=0x21b054, ctx=0x211430)
      at ../../../../../src/gallium/state_trackers/xa/xa_composite.c:445
  #1  xa_composite_prepare (ctx=0x211430, comp=comp@entry=0x21b054)
      at ../../../../../src/gallium/state_trackers/xa/xa_composite.c:488
  #2  0xb6f454b4 in XAPrepareComposite (op=<optimized out>, pSrcPicture=<optimized out>,
      pMaskPicture=<optimized out>, pDstPicture=<optimized out>, pSrc=0x5b3ad8, pMask=0x0,
      pDst=0x5923b8) at msm-exa-xa.c:533

We can't yet handle solid fill mask, so explicitly reject that, rather
than segfaulting.  Otherwise DDX would need to check XA version to see
if solid fill mask were supported.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/state_trackers/xa/xa_composite.c