Reading the code, it looks like we should drop obj in preloadfont: $ darcs diff -u diff -rN -u old-mupdf-official/mupdf/pdf_resources.c new-mupdf-official/mupdf/pdf_resources.c --- old-mupdf-official/mupdf/pdf_resources.c 2009-04-12 17:24:20.578125000 -0700 +++ new-mupdf-official/mupdf/pdf_resources.c 2009-04-12 17:24:20.796875000 -0700 @@ -187,6 +187,7 @@ return fz_rethrow(error, "cannot resolve font resource (%d %d R)", fz_tonum(ref), fz_togen(ref)); error = pdf_loadfont(&font, xref, obj, ref); pdf_dropfont(font); /* we did this just to fill the store, no need to hold on to it */ + fz_dropobj(obj); if (error) return fz_rethrow(error, "cannot load font resource (%d %d R)", fz_tonum(ref), fz_togen(ref)); return fz_okay;
Fixed in the patch that added automatic resolving of indirect references.