Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37794075
en ru br
ALT Linux repos
S:10.01.1-alt1
5.0: 8.64-alt3
4.1: 8.63-alt0.M41.4
4.0: 8.15.4-alt1.M40.4
+updates:8.15.4-alt1.M40.4
3.0: 7.07.1-alt7

Group :: Publishing
RPM: ghostscript

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: FC-subclassing-devices-fix-put_image-method.patch
Download


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: 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.
diff --git a/base/gdevsclass.c b/base/gdevsclass.c
index d9c85d2e4..51092585a 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;
 }
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin