From f2c664a04fa6cf49b3719a0cc4c59f57bab04948 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 20 Nov 2014 12:32:01 +0100 Subject: use pixman images for storage --- rd/read-xwd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'rd') 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); } -- cgit