diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-12-23 14:30:09 +0100 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-12-23 15:01:22 +0100 |
commit | 5688fc10c5e93618efff1345853cc1dd36c34554 (patch) | |
tree | f829cd39dd1af2c89ec26efce1e6c4f67603d200 /source | |
parent | 9d7e833e33e37e0be20b82a9153d18f5148e94d5 (diff) | |
download | mupdf-5688fc10c5e93618efff1345853cc1dd36c34554.tar.xz |
Don't add bogus entries when pdf_update_object is called with NULL.
Treat such calls as deleting the object, as per pdf_delete_object.
Diffstat (limited to 'source')
-rw-r--r-- | source/pdf/pdf-xref.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 6db54472..b20aaee4 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -2128,6 +2128,12 @@ pdf_update_object(fz_context *ctx, pdf_document *doc, int num, pdf_obj *newobj) return; } + if (!newobj) + { + pdf_delete_object(ctx, doc, num); + return; + } + x = pdf_get_incremental_xref_entry(ctx, doc, num); pdf_drop_obj(ctx, x->obj); |