summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-14 06:41:00 +0000
committerDana Jansens <danakj@orodu.net>2003-09-14 06:41:00 +0000
commitd634731fcac81a33e3eb5a5102e926a3c9de953e (patch)
treef1469154769217d14644cf9c20beddf061a69508 /render
parentd89391ec941077c556246bfc49b53919e694fd3e (diff)
X allocs more bytes than i thought, new algo to pick the amount of memory for the bitmap data
Diffstat (limited to 'render')
-rw-r--r--render/mask.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/render/mask.c b/render/mask.c
index d0f375bc..d1659ffb 100644
--- a/render/mask.c
+++ b/render/mask.c
@@ -10,7 +10,7 @@ RrPixmapMask *RrPixmapMaskNew(const RrInstance *inst,
m->width = w;
m->height = h;
/* round up to nearest byte */
- m->data = g_memdup(data, (w * h + 7) / 8);
+ m->data = g_memdup(data, (w + 7) / 8 * h);
m->mask = XCreateBitmapFromData(RrDisplay(inst), RrRootWindow(inst),
data, w, h);
return m;
@@ -56,7 +56,7 @@ RrPixmapMask *RrPixmapMaskCopy(const RrPixmapMask *src)
m->width = src->width;
m->height = src->height;
/* round up to nearest byte */
- m->data = g_memdup(src->data, (src->width * src->height + 7) / 8);
+ m->data = g_memdup(src->data, (src->width + 7) / 8 * src->height);
m->mask = XCreateBitmapFromData(RrDisplay(m->inst), RrRootWindow(m->inst),
m->data, m->width, m->height);
return m;