]> Dogcows Code - chaz/openbox/commitdiff
X allocs more bytes than i thought, new algo to pick the amount of memory for the...
authorDana Jansens <danakj@orodu.net>
Sun, 14 Sep 2003 06:41:00 +0000 (06:41 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 14 Sep 2003 06:41:00 +0000 (06:41 +0000)
render/mask.c

index d0f375bce43f063fa281db218de3976ce8cb016c..d1659ffbb74cba66dec1f8419e9cd4ae5067f960 100644 (file)
@@ -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;
This page took 0.02722 seconds and 4 git commands to generate.