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 /fitz/fitz.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 'fitz/fitz.h')
-rw-r--r-- | fitz/fitz.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h index a10fd4dc..1892bc5e 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -1750,12 +1750,15 @@ typedef struct fz_cookie_s fz_cookie; may change from -1 to a positive value once an upper bound is known, so take this into consideration when comparing the value of progress to that of progress_max. + + errors: count of errors during current rendering. */ struct fz_cookie_s { int abort; int progress; int progress_max; /* -1 for unknown */ + int errors; }; /* |