--- rxvt-unicode/src/rxvtimg.C 2017/07/15 08:16:31 1.109 +++ rxvt-unicode/src/rxvtimg.C 2024/01/10 06:06:16 1.114 @@ -404,7 +404,15 @@ GdkPixbuf *pb = gdk_pixbuf_new_from_file (filename, &err); if (!pb) - rxvt_fatal ("rxvt_img::new_from_file: %s\n", err->message); + try + { + rxvt_fatal ("rxvt_img::new_from_file: %s\n", err->message); + } + catch (...) + { + g_error_free (err); + throw; + } rxvt_img *img = new_from_pixbuf (s, pb); @@ -600,7 +608,8 @@ { // STEP 1: double the image width, fill all odd columns with white (==1) - composer cc (this, new rxvt_img (d, format, 0, 0, w * 2, h, repeat)); + rxvt_img *img = new rxvt_img (d, format, 0, 0, w * 2, h, repeat); + composer cc (this, img); // why the hell does XRenderSetPictureTransform want a writable matrix :( // that keeps us from just static const'ing this matrix. @@ -631,7 +640,7 @@ // a 2x1 filter would obviously suffice, but given the total lack of specification // for xrender, I expect different xrender implementations to randomly diverge. // we also halve the image, and hope for the best (again, for lack of specs). - composer cc2 (cc.dstimg); + composer cc2 (img); XFixed kernel [] = { XDoubleToFixed (3), XDoubleToFixed (1), @@ -650,6 +659,8 @@ XRenderComposite (cc.dpy, PictOpSrc, cc2.src, None, cc2.dst, 0, 0, 0, 0, 0, 0, w * 2, h); + delete img; + return cc2; } @@ -683,7 +694,6 @@ // loop should not be needed for brightness, as only -1..1 makes sense //while (r | g | b | a) { - unsigned short xr, xg, xb, xa; XRenderColor mask_c; if (extract (0, 65535, r, g, b, a, mask_c.red, mask_c.green, mask_c.blue, mask_c.alpha)) @@ -725,7 +735,6 @@ //TODO: this operator does not yet implement some useful contrast while (r | g | b | a) { - unsigned short xr, xg, xb, xa; XRenderColor mask_c; if (extract (0, 65535, r, g, b, a, mask_c.red, mask_c.green, mask_c.blue, mask_c.alpha))