diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2022-05-26 15:51:11 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2022-05-26 15:51:11 +0100 |
commit | 3d5b3cadbad34ec54a6bc1de6e7d4fef678dab40 (patch) | |
tree | f4aac947c0644c4b51bda3fd91b02d87565f1e45 /pdf/pdf_int.c | |
parent | 036510cb897990077f95d9e05ba3daac19bce77e (diff) | |
download | ghostpdl-3d5b3cadbad34ec54a6bc1de6e7d4fef678dab40.tar.gz |
GhostPDF - add more warnings for invalid PDF files
Starting with:
Bug #704948 "Warn about xref stream pointing to xref table"
I've chosen for now at least to make this an error, but continue and
read the xref table anyway unless PDFSTOPONERROR is set. In any event
flag the error.
Also check 'stream' keywords to see that they are terminated by a
linefeed as per the specification. We've seen files where a carriage
return on it's own is used, and if we ignore the problem then the
file runs to completion so this is just a warning currently.
And finally; if we encounter standard xref table entries which are not
exactly 20 bytes long, flag a warning. Again we've seen plenty of
examples where the entry is terminated with a linefeed instead of a
carriage return and linefeed or padding space and linefeed, and if we
ignore the error then the file runs properly. So again this is a warning
not an error.
Diffstat (limited to 'pdf/pdf_int.c')
-rw-r--r-- | pdf/pdf_int.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pdf/pdf_int.c b/pdf/pdf_int.c index 4d5ca2fd5..fe71881ca 100644 --- a/pdf/pdf_int.c +++ b/pdf/pdf_int.c @@ -135,6 +135,7 @@ int pdfi_skip_eol(pdf_context *ctx, pdf_c_stream *s) return 0; if (c >= 0) pdfi_unread_byte(ctx, s, (byte)c); + pdfi_set_warning(ctx, 0, NULL, W_PDF_STREAM_BAD_KEYWORD, "pdfi_skip_eol", NULL); return 0; } |