summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-12-24 12:55:21 +0000
committerRobin Watts <robin.watts@artifex.com>2012-12-24 13:58:23 +0000
commit12f83ab602f913e8e34aab5348339bccc8ace53e (patch)
tree3e0aa6592259c15c8de594bc8ad31ca19e68a805 /fitz
parent6f1b7687de910617cbbf0ea2fb926751782294cd (diff)
downloadmupdf-12f83ab602f913e8e34aab5348339bccc8ace53e.tar.xz
Bug 693503: Fix leak while writing a broken file.
While investigating samples_mupdf_001/2599.pdf.asan.58.1778, a leak showed up while cleaning the file, due to not dropping an object in an error case. mutool clean -dif samples_mupdf_001/2599.pdf.asan.58.1778 leak.pdf Simple Fix. Also extend PDF writing so that it can cope with skipping errors so we at least get something out at the end. Problem found in a test file supplied by Mateusz "j00ru" Jurczyk and Gynvael Coldwind of the Google Security Team using Address Sanitizer. Many thanks!
Diffstat (limited to 'fitz')
-rw-r--r--fitz/fitz.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 1bbedd05..6ece9251 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -2963,6 +2963,9 @@ struct fz_write_options_s
int do_garbage; /* If non-zero then attempt (where possible) to
garbage collect the file before writing. */
int do_linear; /* If non-zero then write linearised. */
+ int continue_on_error; /* If non-zero, errors are (optionally)
+ counted and writing continues. */
+ int *errors; /* Pointer to a place to store a count of errors */
};
/* An enumeration of bitflags to use in the above 'do_expand' field of