diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-11-11 16:05:30 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-11-14 16:09:39 +0000 |
commit | 37f95f87bdfb2e0b01d649afae5fffe60bf99d3a (patch) | |
tree | da3491c62d6af86c1a5bc4e523e8f9ebe19793d1 /source/cbz/mutiff.c | |
parent | c0e1dfdab1a13def046e94d771f8a821ba2a10d9 (diff) | |
download | mupdf-37f95f87bdfb2e0b01d649afae5fffe60bf99d3a.tar.xz |
Make fz_buffer structure private to fitz.
Move the definition of the structure contents into new fitz-imp.h
file. Make all code outside of fitz access the buffer through the
defined API.
Add a convenience API for people that want to get buffers as
null terminated C strings.
Diffstat (limited to 'source/cbz/mutiff.c')
-rw-r--r-- | source/cbz/mutiff.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/cbz/mutiff.c b/source/cbz/mutiff.c index 44f55c7c..44756b88 100644 --- a/source/cbz/mutiff.c +++ b/source/cbz/mutiff.c @@ -68,7 +68,10 @@ tiff_load_page(fz_context *ctx, tiff_document *doc, int number) fz_try(ctx) { - pixmap = fz_load_tiff_subimage(ctx, doc->buffer->data, doc->buffer->len, number); + size_t len; + unsigned char *data; + len = fz_buffer_storage(ctx, doc->buffer, &data); + pixmap = fz_load_tiff_subimage(ctx, data, len, number); image = fz_new_image_from_pixmap(ctx, pixmap, NULL); page = fz_new_page(ctx, sizeof *page); @@ -125,8 +128,11 @@ tiff_open_document_with_stream(fz_context *ctx, fz_stream *file) fz_try(ctx) { + size_t len; + unsigned char *data; doc->buffer = fz_read_all(ctx, file, 1024); - doc->page_count = fz_load_tiff_subimage_count(ctx, doc->buffer->data, doc->buffer->len); + len = fz_buffer_storage(ctx, doc->buffer, &data); + doc->page_count = fz_load_tiff_subimage_count(ctx, data, len); } fz_catch(ctx) { |