summaryrefslogtreecommitdiff
path: root/source/cbz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-02-18 11:26:17 +0100
committerTor Andersson <tor.andersson@artifex.com>2015-02-18 11:29:27 +0100
commit7dc088630b8b8871decad9d58985a9205790185e (patch)
treef5fc4b53eb3c57daa6098014fa4a890014b0c468 /source/cbz
parent1c037cd7aeb3bad78ff0e2eda17b295252984056 (diff)
downloadmupdf-7dc088630b8b8871decad9d58985a9205790185e.tar.xz
Fix typos and reference counting errors in CBZ.
Diffstat (limited to 'source/cbz')
-rw-r--r--source/cbz/mucbz.c1
-rw-r--r--source/cbz/muimg.c8
-rw-r--r--source/cbz/mutiff.c1
3 files changed, 3 insertions, 7 deletions
diff --git a/source/cbz/mucbz.c b/source/cbz/mucbz.c
index 8ea782aa..c85cca45 100644
--- a/source/cbz/mucbz.c
+++ b/source/cbz/mucbz.c
@@ -148,7 +148,6 @@ cbz_drop_page_imp(fz_context *ctx, cbz_page *page)
if (!page)
return;
fz_drop_image(ctx, page->image);
- fz_free(ctx, page);
}
static cbz_page *
diff --git a/source/cbz/muimg.c b/source/cbz/muimg.c
index 0680c15a..169fec95 100644
--- a/source/cbz/muimg.c
+++ b/source/cbz/muimg.c
@@ -33,7 +33,7 @@ img_count_pages(fz_context *ctx, img_document *doc)
static fz_rect *
img_bound_page(fz_context *ctx, img_page *page, fz_rect *bbox)
{
- fz_image *image = (fz_image *)page;
+ fz_image *image = page->image;
int xres, yres;
fz_image_get_sanitised_res(image, &xres, &yres);
bbox->x0 = bbox->y0 = 0;
@@ -46,7 +46,7 @@ static void
img_run_page(fz_context *ctx, img_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie)
{
fz_matrix local_ctm = *ctm;
- fz_image *image = (fz_image *)page;
+ fz_image *image = page->image;
int xres, yres;
float w, h;
fz_image_get_sanitised_res(image, &xres, &yres);
@@ -127,13 +127,11 @@ img_open_document_with_stream(fz_context *ctx, fz_stream *stm)
}
fz_always(ctx)
{
+ fz_drop_image(ctx, image);
fz_drop_buffer(ctx, buffer);
- fz_drop_stream(ctx, stm);
}
fz_catch(ctx)
- {
fz_rethrow(ctx);
- }
return doc;
}
diff --git a/source/cbz/mutiff.c b/source/cbz/mutiff.c
index c0b9cff0..3a30cc79 100644
--- a/source/cbz/mutiff.c
+++ b/source/cbz/mutiff.c
@@ -52,7 +52,6 @@ tiff_drop_page_imp(fz_context *ctx, tiff_page *page)
if (!page)
return;
fz_drop_image(ctx, page->image);
- fz_free(ctx, page);
}
static tiff_page *