From 12f83ab602f913e8e34aab5348339bccc8ace53e Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 24 Dec 2012 12:55:21 +0000 Subject: 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! --- fitz/fitz.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fitz') 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 -- cgit v1.2.3