diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-11-22 08:18:38 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-11-22 08:18:38 +0000 |
commit | 65d530b59b957cc5f303ae819baad8075a555ac0 (patch) | |
tree | 9b81c9d14323627b373354b76c56c578a80a6004 | |
parent | d3a49f36395d737698616fe8ba9da7b74cd2d89a (diff) |
Revert "uxa: Refactor early-exit paths of uxa_try_driver_composite()."
This reverts commit fa5c573455cf63090dbb6d167d4e5f1cb23daf72 as it
causes a SIGSEGV.
Reported-by: lu hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57389
-rw-r--r-- | uxa/uxa-render.c | 79 |
1 files changed, 51 insertions, 28 deletions
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c index 3678f6a5..d783ea26 100644 --- a/uxa/uxa-render.c +++ b/uxa/uxa-render.c @@ -965,9 +965,8 @@ uxa_try_driver_composite(CARD8 op, int xDst_copy = 0, yDst_copy = 0; int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y; PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix; - PicturePtr localSrc = NULL, localMask = NULL; + PicturePtr localSrc, localMask = NULL; PicturePtr localDst = pDst; - int ret = 0; if (uxa_screen->info->check_composite && !(*uxa_screen->info->check_composite) (op, pSrc, pMask, pDst, width, height)) @@ -1019,8 +1018,9 @@ uxa_try_driver_composite(CARD8 op, pDstPix = uxa_get_offscreen_pixmap(localDst->pDrawable, &dst_off_x, &dst_off_y); if (!pDstPix) { - ret = -1; - goto error; + if (localDst != pDst) + FreePicture(localDst, 0); + return -1; } xDst += localDst->pDrawable->x; @@ -1031,8 +1031,9 @@ uxa_try_driver_composite(CARD8 op, width, height, &xSrc, &ySrc); if (!localSrc) { - ret = 0; - goto error; + if (localDst != pDst) + FreePicture(localDst, 0); + return 0; } if (pMask) { @@ -1041,38 +1042,72 @@ uxa_try_driver_composite(CARD8 op, width, height, &xMask, &yMask); if (!localMask) { - ret = 0; - goto error; + if (localSrc != pSrc) + FreePicture(localSrc, 0); + if (localDst != pDst) + FreePicture(localDst, 0); + + return 0; } } if (!miComputeCompositeRegion(®ion, localSrc, localMask, localDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height)) { - ret = 1; - goto error; + if (localSrc != pSrc) + FreePicture(localSrc, 0); + if (localMask && localMask != pMask) + FreePicture(localMask, 0); + if (localDst != pDst) + FreePicture(localDst, 0); + + return 1; } pSrcPix = uxa_get_offscreen_pixmap(localSrc->pDrawable, &src_off_x, &src_off_y); if (!pSrcPix) { - ret = 0; - goto error; + REGION_UNINIT(screen, ®ion); + + if (localSrc != pSrc) + FreePicture(localSrc, 0); + if (localMask && localMask != pMask) + FreePicture(localMask, 0); + if (localDst != pDst) + FreePicture(localDst, 0); + + return 0; } if (localMask) { pMaskPix = uxa_get_offscreen_pixmap(localMask->pDrawable, &mask_off_x, &mask_off_y); if (!pMaskPix) { - ret = 0; - goto error; + REGION_UNINIT(screen, ®ion); + + if (localSrc != pSrc) + FreePicture(localSrc, 0); + if (localMask && localMask != pMask) + FreePicture(localMask, 0); + if (localDst != pDst) + FreePicture(localDst, 0); + + return 0; } } if (!(*uxa_screen->info->prepare_composite) (op, localSrc, localMask, localDst, pSrcPix, pMaskPix, pDstPix)) { - ret = -1; - goto error; + REGION_UNINIT(screen, ®ion); + + if (localSrc != pSrc) + FreePicture(localSrc, 0); + if (localMask && localMask != pMask) + FreePicture(localMask, 0); + if (localDst != pDst) + FreePicture(localDst, 0); + + return -1; } if (pMask) { @@ -1121,18 +1156,6 @@ uxa_try_driver_composite(CARD8 op, } return 1; - -error: - REGION_UNINIT(screen, ®ion); - - if (localSrc && localSrc != pSrc) - FreePicture(localSrc, 0); - if (localMask && localMask != pMask) - FreePicture(localMask, 0); - if (localDst != pDst) - FreePicture(localDst, 0); - - return ret; } /** |