diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-06 17:20:39 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-06 17:20:39 +0100 |
commit | 902391bd798775e1a7a53503d4dd1756162f737f (patch) | |
tree | 76e67b3f1278ca2a248a6e43580f61f18ec86bfc /uxa | |
parent | 3d8a1f7176877975a31ad7a6548fa8309065f617 (diff) |
uxa: Remove dead-code for SourcePictures
All SourcePictures are now converted into Drawables, which had been
assumed by the driver backend. However, the code still existed to
attempt to pass procedural pictures onwards and so set pSrcPix to NULL
which was being flagged by the static analyser as a potential NULL
dereference.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'uxa')
-rw-r--r-- | uxa/uxa-render.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c index 1e88c5d7..4463dc2f 100644 --- a/uxa/uxa-render.c +++ b/uxa/uxa-render.c @@ -1064,10 +1064,25 @@ uxa_try_driver_composite(CARD8 op, return 1; } - if (localSrc->pDrawable) { - pSrcPix = uxa_get_offscreen_pixmap(localSrc->pDrawable, - &src_off_x, &src_off_y); - if (!pSrcPix) { + pSrcPix = uxa_get_offscreen_pixmap(localSrc->pDrawable, + &src_off_x, &src_off_y); + if (!pSrcPix) { + 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) { REGION_UNINIT(screen, ®ion); if (localSrc != pSrc) @@ -1079,29 +1094,6 @@ uxa_try_driver_composite(CARD8 op, return 0; } - } else { - pSrcPix = NULL; - } - - if (localMask) { - if (localMask->pDrawable) { - pMaskPix = uxa_get_offscreen_pixmap(localMask->pDrawable, - &mask_off_x, &mask_off_y); - if (!pMaskPix) { - 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; - } - } else { - pMaskPix = NULL; - } } if (!(*uxa_screen->info->prepare_composite) |