 +
 +			if (chapter_stack_depth == 0)
 +			{
++				fz_try(ctx)
++				{
++					outline = fz_new_outline(ctx);
++				}
++				fz_catch(ctx)
++				{
++					fz_drop_outline(ctx, outline);
++					fz_rethrow(ctx);
++				}
 +				chapter_stack[0] = outline;
 +				chapter_stack_depth = 1;
 +				current_chapter = outline;

    a comic book archive.

diff --git a/source/cbz/mucbz.c b/source/cbz/mucbz.c
index 0c93aa458..413205fdf 100644
--- a/source/cbz/mucbz.c
+++ b/source/cbz/mucbz.c
@@ -233,6 +233,100 @@ cbz_lookup_metadata(fz_context *ctx, fz_document *doc_, const char *key, char *b
 	return -1;
 }
 

+cbz_load_outline(fz_context *ctx, fz_document *doc_)
+{
+	cbz_document *doc = (cbz_document *) doc_;
+	fz_outline *outline = NULL;
+	size_t max_chapter_stack_depth = 10;
+	fz_outline *chapter_stack[max_chapter_stack_depth];
+	size_t chapter_stack_depth = 0;
