summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-resources.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/pdf/pdf-resources.c b/source/pdf/pdf-resources.c
index 7c1f36ad..ad195393 100644
--- a/source/pdf/pdf-resources.c
+++ b/source/pdf/pdf-resources.c
@@ -147,6 +147,9 @@ res_table_free(fz_context *ctx, fz_hash_table *hash)
void
pdf_drop_resource_tables(fz_context *ctx, pdf_document *doc)
{
- res_table_free(ctx, doc->resources.fonts);
- res_table_free(ctx, doc->resources.images);
+ if (doc)
+ {
+ res_table_free(ctx, doc->resources.fonts);
+ res_table_free(ctx, doc->resources.images);
+ }
}