summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-08-09 13:03:51 +0100
committerRobin Watts <Robin.Watts@artifex.com>2021-08-09 13:12:11 +0100
commit2d6346ed529de708b8261d173027647f6534c671 (patch)
tree47e569e8a7924b0411dda7c97bdbc746662aaef5
parent6de7fee9b74fc0a1c6f45c064ed40474df899efc (diff)
downloadghostpdl-2d6346ed529de708b8261d173027647f6534c671.tar.gz
Fix subclass initialisation problems with pclm and pdfimage.
We were instantiating the internal subclass devices, and then accessing the wrong device in the chain.
-rw-r--r--devices/gdevpdfimg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/devices/gdevpdfimg.c b/devices/gdevpdfimg.c
index 3312eee62..ae0d1fb2e 100644
--- a/devices/gdevpdfimg.c
+++ b/devices/gdevpdfimg.c
@@ -898,7 +898,7 @@ pdf_image_print_page(gx_device_printer * pdev, gp_file * file)
int
pdf_image_open(gx_device *pdev)
{
- gx_device_pdf_image *ppdev = (gx_device_pdf_image *)pdev;
+ gx_device_pdf_image *ppdev;
int code;
bool update_procs = false;
@@ -909,6 +909,7 @@ pdf_image_open(gx_device *pdev)
while(pdev->child)
pdev = pdev->child;
+ ppdev = (gx_device_pdf_image *)pdev;
ppdev->file = NULL;
ppdev->Pages = NULL;
ppdev->NumPages = 0;
@@ -1222,7 +1223,7 @@ PCLm_open_temp_stream(gx_device_pdf_image *pdev, PCLm_temp_file_t *ptf)
int
PCLm_open(gx_device *pdev)
{
- gx_device_pdf_image *ppdev = (gx_device_pdf_image *)pdev;
+ gx_device_pdf_image *ppdev;
int code;
bool update_procs = false;
@@ -1233,6 +1234,7 @@ PCLm_open(gx_device *pdev)
while(pdev->child)
pdev = pdev->child;
+ ppdev = (gx_device_pdf_image *)pdev;
memset(&ppdev->ocr, 0, sizeof(ppdev->ocr));
ppdev->file = NULL;
ppdev->Pages = NULL;