da972996b4
- ghostscript-2.26-subclassing-devices-fix-put_image-method.patch fixes Ghostscript issue #700315 and bsc#1121490 https://bugs.ghostscript.com/show_bug.cgi?id=700315 Segfault in GS 9.26 with certain PDFs with -dLastPage=1 OBS-URL: https://build.opensuse.org/request/show/664448 OBS-URL: https://build.opensuse.org/package/show/Printing/ghostscript?expand=0&rev=101
35 lines
1.4 KiB
Diff
35 lines
1.4 KiB
Diff
From fae21f1668d2b44b18b84cf0923a1d5f3008a696 Mon Sep 17 00:00:00 2001
|
|
From: Ken Sharp <ken.sharp@artifex.com>
|
|
Date: Tue, 4 Dec 2018 21:31:31 +0000
|
|
Subject: [PATCH] subclassing devices - fix put_image method
|
|
|
|
The subclassing devices need to change the 'memory device' parameter to
|
|
be the child device, when its the same as the subclassing device.
|
|
|
|
Otherwise we end up trying to access the child device's memory pointers
|
|
in the subclassing device, which may not contain valid copies of
|
|
those pointers.
|
|
---
|
|
base/gdevsclass.c | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/base/gdevsclass.c b/base/gdevsclass.c
|
|
index d9c85d2..5109258 100644
|
|
--- a/base/gdevsclass.c
|
|
+++ b/base/gdevsclass.c
|
|
@@ -797,7 +797,10 @@ int default_subclass_put_image(gx_device *dev, gx_device *mdev, const byte **buf
|
|
int alpha_plane_index, int tag_plane_index)
|
|
{
|
|
if (dev->child)
|
|
- return dev_proc(dev->child, put_image)(dev->child, mdev, buffers, num_chan, x, y, width, height, row_stride, alpha_plane_index, tag_plane_index);
|
|
+ if (dev == mdev)
|
|
+ return dev_proc(dev->child, put_image)(dev->child, dev->child, buffers, num_chan, x, y, width, height, row_stride, alpha_plane_index, tag_plane_index);
|
|
+ else
|
|
+ return dev_proc(dev->child, put_image)(dev->child, mdev, buffers, num_chan, x, y, width, height, row_stride, alpha_plane_index, tag_plane_index);
|
|
|
|
return 0;
|
|
}
|
|
--
|
|
2.9.1
|
|
|