mirror of
https://github.com/qpdf/qpdf.git
synced 2024-09-27 20:49:06 +00:00
Treat content stream parsing errors as an error, not a warning
If parsing content streams is treated as a warning, there is no way for a caller to know if a parsing operation has failed. This is very dangerous and will likely result in data loss when token filters are parser callbacks are in use.
This commit is contained in:
parent
6c89d4b35b
commit
38c9ed23c3
@ -1290,10 +1290,9 @@ QPDFObjectHandle::pipeContentStreams(
|
|||||||
if (! stream.pipeStreamData(p, 0, qpdf_dl_specialized))
|
if (! stream.pipeStreamData(p, 0, qpdf_dl_specialized))
|
||||||
{
|
{
|
||||||
QTC::TC("qpdf", "QPDFObjectHandle errors in parsecontent");
|
QTC::TC("qpdf", "QPDFObjectHandle errors in parsecontent");
|
||||||
warn(stream.getOwningQPDF(),
|
throw QPDFExc(qpdf_e_damaged_pdf, "content stream",
|
||||||
QPDFExc(qpdf_e_damaged_pdf, "content stream",
|
description, 0,
|
||||||
description, 0,
|
"errors while decoding content stream");
|
||||||
"errors while decoding content stream"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,4 @@ WARNING: split-content-stream-errors.pdf (offset 557): error decoding stream dat
|
|||||||
WARNING: split-content-stream-errors.pdf (offset 557): stream will be re-processed without filtering to avoid data loss
|
WARNING: split-content-stream-errors.pdf (offset 557): stream will be re-processed without filtering to avoid data loss
|
||||||
WARNING: page object 3 0 (item index 0 (from 0)): ignoring non-stream in an array of streams
|
WARNING: page object 3 0 (item index 0 (from 0)): ignoring non-stream in an array of streams
|
||||||
WARNING: split-content-stream-errors.pdf (offset 557): error decoding stream data for object 6 0: LZWDecoder: bad code received
|
WARNING: split-content-stream-errors.pdf (offset 557): error decoding stream data for object 6 0: LZWDecoder: bad code received
|
||||||
WARNING: content stream (content stream object 6 0): errors while decoding content stream
|
page 1: content stream (content stream object 6 0): errors while decoding content stream
|
||||||
|
Loading…
Reference in New Issue
Block a user