diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-06-11 15:50:30 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-06-11 19:55:53 +0100 |
commit | 120dabdf30be66b5d17f4c59862907bb5d176e27 (patch) | |
tree | 509ac66222e21248e98fd55eaf0408e098222878 /apps/pdfapp.h | |
parent | b42125b79edc28af6508145a24308674403a8460 (diff) | |
download | mupdf-120dabdf30be66b5d17f4c59862907bb5d176e27.tar.xz |
Fix Bug 693099: Render failure due to corrupt jpeg data.
The file supplied with the bug contains corrupt jpeg data on page
61. This causes an error to be thrown which results in mudraw
exiting.
Previously, when image decode was done at loading time, the error
would have been thrown under the pdf interpreter rather than under
the display list renderer. This error would have been caught, a
warning given, and the program would have continued. This is not
ideal behaviour, as there is no way for a caller to know that there
was a problem, and that the image is potentially incomplete.
The solution adopted here, solves both these problems. The fz_cookie
structure is expanded to include a 'errors' count. Whenever we meet
an error during rendering, we increment the 'errors' count, and
continue.
This enables applications to spot the errors count being non-zero on
exit and to display a warning.
mupdf is updated here to pass a cookie in and to check the error count
at the end; if it is found to be non zero, then a warning is given (just
once per visit to each page) to say that the page may have errors on it.
Diffstat (limited to 'apps/pdfapp.h')
-rw-r--r-- | apps/pdfapp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/pdfapp.h b/apps/pdfapp.h index f93b816a..31ad18e1 100644 --- a/apps/pdfapp.h +++ b/apps/pdfapp.h @@ -56,6 +56,7 @@ struct pdfapp_s fz_text_page *page_text; fz_text_sheet *page_sheet; fz_link *page_links; + int errored; /* snapback history */ int hist[256]; |