Blob Blame History Raw
From c0502b3771e4eac89a199a3558182337d146d4ab Mon Sep 17 00:00:00 2001
From: Michael Vrhel <michael.vrhel@artifex.com>
Date: Thu, 29 Dec 2016 12:00:40 -0800
Subject: [PATCH] Bug 697444 Unmatched transparency group pop

This issue can only occur if there is an unmatched group pop.
If the interpreter is doing that, then the interpreter is
broken.  With this bug the user is intentionally doing it.
We now throw and error when it occurs.
---
 base/gdevp14.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/base/gdevp14.c b/base/gdevp14.c
index ad3478f..84f0f40 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -985,6 +985,9 @@ pdf14_pop_transparency_group(gs_gstate *pgs, pdf14_ctx *ctx,
     bool blendspot = pdev->blendspot;
     bool nonicc_conversion = true;
 
+    if (nos == NULL)
+        return_error(gs_error_unknownerror);  /* Unmatched group pop */
+
 #ifdef DEBUG
     pdf14_debug_mask_stack_state(ctx);
 #endif
-- 
2.9.3