From f85653219a85a9f91cb14471485611ca5f6b25ba Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 13 Jun 2013 16:00:35 +0100 Subject: Make display lists reference counted objects. Remove fz_free_display_list from the API; instead use fz_drop_display_list. --- fitz/text_extract.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'fitz/text_extract.c') diff --git a/fitz/text_extract.c b/fitz/text_extract.c index bf50e6a4..01a789fd 100644 --- a/fitz/text_extract.c +++ b/fitz/text_extract.c @@ -369,7 +369,12 @@ fz_new_text_sheet(fz_context *ctx) void fz_free_text_sheet(fz_context *ctx, fz_text_sheet *sheet) { - fz_text_style *style = sheet->style; + fz_text_style *style; + + if (sheet == NULL) + return; + + style = sheet->style; while (style) { fz_text_style *next = style->next; @@ -478,6 +483,8 @@ void fz_free_text_page(fz_context *ctx, fz_text_page *page) { fz_page_block *block; + if (page == NULL) + return; for (block = page->blocks; block < page->blocks + page->len; block++) { switch (block->type) -- cgit v1.2.3