--- rxvt-unicode/src/rxvtimg.C 2012/06/03 20:34:25 1.7 +++ rxvt-unicode/src/rxvtimg.C 2012/06/03 20:47:00 1.9 @@ -218,24 +218,17 @@ rxvt_img * rxvt_img::convert_to (XRenderPictFormat *new_format) { + rxvt_img *img = new rxvt_img (s,new_format,w, h); + Display *dpy = s->display->dpy; - Pixmap new_pm = XCreatePixmap (dpy, pm, w, h, new_format->depth); Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0); - Picture dst = XRenderCreatePicture (dpy, new_pm, new_format, 0, 0); + Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0); XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h); XRenderFreePicture (dpy, src); XRenderFreePicture (dpy, dst); - rxvt_img *img = new rxvt_img ( - s, - new_format, - w, - h, - new_pm - ); - return img; }