summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2011-11-05 13:00:07 +0100
committerJeremy Huddleston <jeremyhu@apple.com>2011-12-21 09:52:21 -0800
commitb736f8c92bae7773ff6e1fca886f9ccc50156488 (patch)
tree26af0861a426aa5ec2e77857456761df04e14c06
parentb2a4c09507b267495ea5e4c2e05373b323c80edf (diff)
Fix ShmPutImage for XYBitmap
We can't call CopyArea in that case because the image has depth 1, which might not match the target drawable, so we might overrun the shm segment. Commit 11817a881cb93a89788105d1e575a468f2a8d27c apparently fixed a similar bug for XYPixmap, but missed the bitmap case. Fixes: http://bugs.debian.org/629611 Thanks to Alan Curry for diagnosing this and providing a test case. Reported-and-tested-by: Alan Curry <pacman@kosh.dhis.org> Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Julien Cristau <jcristau@debian.org> (cherry picked from commit 08ec4da6a7617637914bee1636858474213cf39d)
-rw-r--r--Xext/shm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Xext/shm.c b/Xext/shm.c
index 4141a8fe6..d2ae08772 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -482,7 +482,7 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
{
PixmapPtr pPixmap;
- if (format == ZPixmap || depth == 1) {
+ if (format == ZPixmap || (format == XYPixmap && depth == 1)) {
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth),
PixmapBytePad(w, depth),