Parsimony
[llpp.git] / misc / cbzl.patch
blob00fb2b7bc230cdbec31187a56df8e59ab8ee5b36
1 diff --git a/source/cbz/mucbz.c b/source/cbz/mucbz.c
2 index f018d1c..ebaf743 100644
3 --- a/source/cbz/mucbz.c
4 +++ b/source/cbz/mucbz.c
5 @@ -116,8 +116,17 @@ cbz_read_zip_entry(cbz_document *doc, int offset, int *sizep)
7 if (method == 0)
9 - *sizep = usize;
10 - return cdata;
11 + fz_buffer *buf;
12 + fz_stream *stm;
13 + unsigned char *udata;
15 + cdata[csize] = 0;
16 + stm = fz_open_file (ctx, (char *) cdata);
17 + buf = fz_read_all (stm, 0);
18 + fz_close (stm);
19 + fz_free (ctx, cdata);
20 + *sizep = fz_buffer_storage (ctx, buf, &udata);;
21 + return udata;
24 if (method == 8)