summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2016-12-29 14:00:21 -0800
committerMichael Vrhel <michael.vrhel@artifex.com>2016-12-29 14:00:21 -0800
commit90fd0c7ca3efc1ddff64a86f4104b13b3ac969eb (patch)
tree08ec0c61351e4536a6476ba41d4c42140e92d9f8
parentd621292fb2c8157d9899dcd83fd04dd250e30fe4 (diff)
Bug 697456. Dont create new ctx when pdf14 device reenabled
This bug had yet another weird case where the user created a file that pushed the pdf14 device twice. We were in that case, creating a new ctx and blowing away the original one with out proper clean up. To avoid, only create a new one when we need it.
-rw-r--r--base/gdevp14.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/base/gdevp14.c b/base/gdevp14.c
index fd56ec975..f19318ee7 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -1669,8 +1669,10 @@ pdf14_open(gx_device *dev)
1669 rect.p.y = 0; 1669 rect.p.y = 0;
1670 rect.q.x = dev->width; 1670 rect.q.x = dev->width;
1671 rect.q.y = dev->height; 1671 rect.q.y = dev->height;
1672 pdev->ctx = pdf14_ctx_new(&rect, dev->color_info.num_components, 1672 /* If we are reenabling the device dont create a new ctx. Bug 697456 */
1673 pdev->color_info.polarity != GX_CINFO_POLARITY_SUBTRACTIVE, dev); 1673 if (pdev->ctx == NULL)
1674 pdev->ctx = pdf14_ctx_new(&rect, dev->color_info.num_components,
1675 pdev->color_info.polarity != GX_CINFO_POLARITY_SUBTRACTIVE, dev);
1674 if (pdev->ctx == NULL) 1676 if (pdev->ctx == NULL)
1675 return_error(gs_error_VMerror); 1677 return_error(gs_error_VMerror);
1676 pdev->free_devicen = true; 1678 pdev->free_devicen = true;