From 83cff9734876e9454476086b79da15db1234e7b6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 12 Dec 2016 12:41:25 +0100 Subject: pdf: Add missing prepare_object_for_alteration calls. pdf_array_delete and pdf_dict_put_val_null weren't calling this function. --- source/pdf/pdf-object.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/pdf/pdf-object.c') diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c index 2b0526bd..51f6a679 100644 --- a/source/pdf/pdf-object.c +++ b/source/pdf/pdf-object.c @@ -797,6 +797,7 @@ pdf_array_delete(fz_context *ctx, pdf_obj *obj, int i) if (i < 0 || i >= ARRAY(obj)->len) fz_throw(ctx, FZ_ERROR_GENERIC, "index out of bounds"); + prepare_object_for_alteration(ctx, obj, NULL); pdf_drop_obj(ctx, ARRAY(obj)->items[i]); ARRAY(obj)->items[i] = 0; ARRAY(obj)->len--; @@ -1059,6 +1060,7 @@ pdf_dict_put_val_null(fz_context *ctx, pdf_obj *obj, int idx) if (idx < 0 || idx >= DICT(obj)->len) fz_throw(ctx, FZ_ERROR_GENERIC, "index out of bounds"); + prepare_object_for_alteration(ctx, obj, NULL); pdf_drop_obj(ctx, DICT(obj)->items[idx].v); DICT(obj)->items[idx].v = PDF_OBJ_NULL; } -- cgit v1.2.3