Skip to content

Commit

Permalink
xa: fix segfault
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
freedreno-zz committed Jun 11, 2014
1 parent 70ce103 commit 50f1cbe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gallium/state_trackers/xa/xa_composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ xa_composite_prepare(struct xa_context *ctx,
struct xa_surface *dst_srf = comp->dst->srf;
int ret;

if (comp->mask && !comp->mask->srf)
return -XA_ERR_INVAL;

ret = xa_ctx_srf_create(ctx, dst_srf);
if (ret != XA_ERR_NONE)
return ret;
Expand Down

0 comments on commit 50f1cbe

Please sign in to comment.