[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2698-geb1f4fa

[email protected] (Nancy Durgin) Wed, 18 Dec 2019 22:50:37 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  eb1f4fa7be54c3a5ee629589dc47fc7e28877d71 (commit)
      from  1c79cabbe0e9d085160b9257558186a809dc9d85 (commit)

----------------------------------------------------------------------
commit eb1f4fa7be54c3a5ee629589dc47fc7e28877d71
Author: Nancy Durgin <[email protected]>
Date:   Wed Dec 18 12:27:55 2019 -0800

    Fix transparency check for annotations
    
    It wasn't actually checking for transparency due to typo, so no transparency
    was working.
    
    See: tests_private/pdf/sumatra/annotations_galore_II.pdf
    
    Also fix crash dealing with invalid font in Resource
    
    This was crashing in pdfi_check_Font() on
    tests_private/comparefiles/Bug689450.pdf
    
    Now we don't try to look things up in the font if it's not a dictionary...

diff --git a/pdf/pdf_check.c b/pdf/pdf_check.c
index 0bf46b8..6a83ed8 100644
--- a/pdf/pdf_check.c
+++ b/pdf/pdf_check.c
@@ -598,6 +598,9 @@ static int pdfi_check_Font(pdf_context *ctx, pdf_dict *font, pdf_dict *page_dict
     int code = 0;
     pdf_obj *o = NULL;
 
+    if (font->type != PDF_DICT)
+        return_error(gs_error_typecheck);
+
     code = pdfi_dict_knownget_type(ctx, font, "Subtype", PDF_NAME, &o);
     if (code > 0) {
         if (pdfi_name_is((pdf_name *)o, "Type3")) {
@@ -823,7 +826,7 @@ static int pdfi_check_Annots_for_transparency(pdf_context *ctx, pdf_array *annot
 
     for (i=0; i < pdfi_array_size(annots_array); i++) {
         code = pdfi_array_get_type(ctx, annots_array, (uint64_t)i, PDF_DICT, (pdf_obj **)&annot);
-        if (code > 0) {
+        if (code >= 0) {
             code = pdfi_check_annot_for_transparency(ctx, annot, page_dict, transparent, num_spots);
             if (code < 0 && ctx->pdfstoponerror)
                 goto exit;


Summary of changes:
 pdf/pdf_check.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)