diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2011-10-14 17:07:38 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2011-10-14 17:14:51 +0100 |
commit | 7b498fc5e1d0532f60e70e244edfc58bbeb18a50 (patch) | |
tree | b060187b382ce80ee22cd60a5a3f34c0aaaf9e23 /gs/base/gdevmem.c | |
parent | 419d3f8f787d90a71623b27100972eca64d03cc1 (diff) |
Fix planar device bug; tiles becoming corrupted on gc.
The relocation code for memory devices had not been updated to cope
with planar stuff; as such only the first 'mdev->height' line pointers
were being updated. This was showing up in plank vs pamcmyk4 testing
as some planes of patterns being corrupted.
Diffstat (limited to 'gs/base/gdevmem.c')
-rw-r--r-- | gs/base/gdevmem.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gs/base/gdevmem.c b/gs/base/gdevmem.c index 3f1953461..fd7eb6417 100644 --- a/gs/base/gdevmem.c +++ b/gs/base/gdevmem.c @@ -45,10 +45,14 @@ RELOC_PTRS_WITH(device_memory_reloc_ptrs, gx_device_memory *mptr) byte *base_old = mptr->base; long reloc; int y; + int h = mptr->height; + + if (mptr->num_planes > 0) + h *= mptr->num_planes; RELOC_PTR(gx_device_memory, base); reloc = base_old - mptr->base; - for (y = 0; y < mptr->height; y++) + for (y = 0; y < h; y++) mptr->line_ptrs[y] -= reloc; /* Relocate line_ptrs, which also points into the data area. */ mptr->line_ptrs = (byte **) ((byte *) mptr->line_ptrs - reloc); @@ -446,7 +450,7 @@ gdev_mem_open_scan_lines(gx_device_memory *mdev, int setup_height) gdev_mem_bits_size(mdev, mdev->width, mdev->height, &size); mdev->line_ptrs = (byte **)(mdev->base + size); } - mdev->raster = gdev_mem_raster(mdev); + mdev->raster = gdev_mem_raster(mdev); /* RJW: Wrong for planar */ return gdev_mem_set_line_ptrs(mdev, NULL, 0, NULL, setup_height); } /* |