[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#254206: Patch for 16bpp antialias gs segfault



This patch:

--- src/gdevxini.c~	2002-06-16 06:48:55.000000000 +0100
+++ src/gdevxini.c	2005-09-12 18:11:51.000000000 +0100
@@ -899,7 +899,10 @@
 	dev->is_open = false;
     xdev->IsPageDevice = values.IsPageDevice;
     code = gx_default_put_params(dev, plist);
-    dev->is_open = values.is_open; /* saved value */
+    /* Prevent us from preventing the device closure if the size changed;
+     * that may require us to rebuild the buffer (see x_set_buffer). */
+    if (xdev->width == values.width && xdev->height == values.height)
+	dev->is_open = values.is_open; /* saved value */
     if (code < 0) {		/* Undo setting of .IsPageDevice */
 	xdev->IsPageDevice = save_is_page;
 	return code;

prevents a segfault which I can reproduce with various versions of gs
(particularly, 8.01-5ubuntu1) when antialiasing to a 16bpp display.

My stack traces closely resemble those in #254206.

I will be incorporating this patch in Ubuntu Breezy's gs-gpl and
perhaps its gs-esp too.

Ian.




Reply to: