[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2328-g1494074

[email protected] (Nancy Durgin) Tue, 8 Oct 2019 19:54:44 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  149407471e5b7f95dbf4510e53ee2e21cd85b91f (commit)
      from  56435c081040403fb513244a37f08f5feb2451a1 (commit)

----------------------------------------------------------------------
commit 149407471e5b7f95dbf4510e53ee2e21cd85b91f
Author: Nancy Durgin <[email protected]>
Date:   Tue Oct 8 11:55:01 2019 -0700

    Handle /None in SMask in gs
    
    Fixes tests_private/comparefiles/Bug696324.pdf

diff --git a/pdf/pdf_gstate.c b/pdf/pdf_gstate.c
index 74f3d0e..9e8d106 100644
--- a/pdf/pdf_gstate.c
+++ b/pdf/pdf_gstate.c
@@ -1109,7 +1109,8 @@ static int GS_BM(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict
 
 static int GS_SMask(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
 {
-    pdf_obj *o;
+    pdf_obj *o = NULL;
+    pdfi_int_gstate *igs = (pdfi_int_gstate *)ctx->pgs->client_data;
     int code;
 
     if (ctx->page_has_transparency == false || ctx->notransparency == true)
@@ -1122,9 +1123,10 @@ static int GS_SMask(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_d
     if (o->type == PDF_NAME) {
         pdf_name *n = (pdf_name *)o;
 
-        if (n->length == 4 && memcmp(n->data, "None", 4) == 0) {
-            pdfi_countdown(n);
-            return 0;
+        if (pdfi_name_is(n, "None")) {
+            if (igs->SMask)
+                pdfi_gstate_smask_free(igs);
+            goto exit;
         }
         code = pdfi_find_resource(ctx, (unsigned char *)"ExtGState", n, stream_dict, page_dict, &o);
         pdfi_countdown(n);
@@ -1133,13 +1135,12 @@ static int GS_SMask(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_d
     }
 
     if (o->type == PDF_DICT) {
-        pdfi_int_gstate *igs = (pdfi_int_gstate *)ctx->pgs->client_data;
-
         if (igs->SMask)
             pdfi_gstate_smask_free(igs);
         pdfi_gstate_smask_install(igs, ctx->memory, (pdf_dict *)o, ctx->pgs);
     }
 
+ exit:
     pdfi_countdown(o);
     return 0;
 }


Summary of changes:
 pdf/pdf_gstate.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)