diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2023-03-12 11:44:20 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2023-03-13 08:58:04 +0000 |
commit | faaffb1e32c8d319eeba8538bca16b85930e6aba (patch) | |
tree | fe03a9c5863ef3927eef3cf9f31bb140a24df571 /pdf | |
parent | 1e05a2cd0825027c731a81b35c8f0f7bee133491 (diff) | |
download | ghostpdl-faaffb1e32c8d319eeba8538bca16b85930e6aba.tar.gz |
GhostPDF - ignore null DecodeParams
Bug #706476 "<</DecodeParms null>> causes a bogus warning"
A null object for DecodeParams is legal. Pointless but legal.
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdf_image.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c index b786ba4cb..e446567f2 100644 --- a/pdf/pdf_image.c +++ b/pdf/pdf_image.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018-2022 Artifex Software, Inc. +/* Copyright (C) 2018-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -707,11 +707,14 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj, goto errorExit; } if (info->DecodeParms != NULL && (pdfi_type_of(info->DecodeParms) != PDF_DICT && pdfi_type_of(info->DecodeParms) != PDF_ARRAY)) { + /* null is legal. Pointless but legal. */ + if (pdfi_type_of(info->DecodeParms) != PDF_NULL) { + pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL); + if (ctx->args.pdfstoponwarning) + goto errorExit; + } pdfi_countdown(info->DecodeParms); info->DecodeParms = NULL; - pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL); - if (ctx->args.pdfstoponwarning) - goto errorExit; } return 0; |