aboutsummaryrefslogtreecommitdiffstats
path: root/rd
diff options
context:
space:
mode:
Diffstat (limited to 'rd')
-rw-r--r--rd/read-xwd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/rd/read-xwd.c b/rd/read-xwd.c
index c266624..afaa615 100644
--- a/rd/read-xwd.c
+++ b/rd/read-xwd.c
@@ -344,12 +344,11 @@ parse_ximage(struct ida_image *dest, XImage *src)
memset(dest,0,sizeof(*dest));
dest->i.width = src->width;
dest->i.height = src->height;
- dest->data = malloc(dest->i.width * dest->i.height * 3);
- memset(dest->data,0,dest->i.width * dest->i.height * 3);
-
+ ida_image_alloc(dest);
+
for (y = 0; y < src->height; y++) {
h.row = src->data + y*src->bytes_per_line;
- xwd_parse(dest->data + 3*y*dest->i.width, y, &h);
+ xwd_parse(ida_image_scanline(dest, y), y, &h);
}
free(h.pix);
}