Created attachment 14618 [details] Minimzed PDF from oss-fuzz. The backtrace looks like this, though valgrind and build=sanitize do not reproduce this, perhaps some new -fsanitize= option will find something? Direct leak of 11352 byte(s) in 1 object(s) allocated from: #0 0x4e1398 in malloc _asan_rtl_ #1 0x65ee42 in do_scavenging_malloc /src/mupdf/source/fitz/memory.c:22:7 #2 0x65f31d in fz_calloc /src/mupdf/source/fitz/memory.c:124:6 #3 0x719b88 in fz_new_device_of_size /src/mupdf/source/fitz/device.c:9:19 #4 0x5c122c in new_draw_device /src/mupdf/source/fitz/draw-device.c:2975:24 #5 0x6a3e86 in fz_new_pixmap_from_page /src/mupdf/source/fitz/util.c:236:9 #6 0x6a4176 in fz_new_pixmap_from_page_number /src/mupdf/source/fitz/util.c:261:9
I have a proposed fix for this awaiting review.
Fixed in commit 8aa2bd34065d2844aae778bd4cc20c74bbcd9406 Author: Sebastian Rasmussen <sebras@gmail.com> Date: Sun Aug 12 04:14:03 2018 +0800 Bug 698887: Fix leak of device/pixmap when rendering fails.