From 9ccaed06546b9ca260b29707fbd3327c3af9314d Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 13 Mar 2012 21:18:34 +0000 Subject: Fix for potential problems on allocation failure. Taken from Sumatra.patch - many thanks. --- cbz/mucbz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cbz/mucbz.c b/cbz/mucbz.c index 08f21bb6..0050af29 100644 --- a/cbz/mucbz.c +++ b/cbz/mucbz.c @@ -203,8 +203,8 @@ cbz_read_zip_dir_imp(cbz_document *doc, int startoffset) (void) getlong(file); /* size of central directory */ offset = getlong(file); /* offset to central directory */ + doc->entry = fz_calloc(ctx, count, sizeof(cbz_entry)); doc->entry_count = count; - doc->entry = fz_malloc_array(ctx, count, sizeof(cbz_entry)); fz_seek(file, offset, 0); -- cgit v1.2.3