summaryrefslogtreecommitdiff
path: root/source/tools/murun.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-11-25 14:25:49 +0000
committerRobin Watts <Robin.Watts@artifex.com>2016-12-08 11:57:22 +0000
commit907e47b14bbe54732f760962695f853678fc3899 (patch)
treef34faf30a2d11fced42252227d2013b7308f1435 /source/tools/murun.c
parent4916a2fa24e65fab1e961a5a6702c929287ed39c (diff)
downloadmupdf-907e47b14bbe54732f760962695f853678fc3899.tar.xz
Update pdf_array_put to allow extension.
Previously, attempting to put an object beyond the end of an array would throw an error. Here we update the code to allow objects to be placed *exactly* at the end (i.e. to extend the length by 1). Update js use of pdf_array_put.
Diffstat (limited to 'source/tools/murun.c')
-rw-r--r--source/tools/murun.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c
index 63266226..5469483a 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -2929,10 +2929,7 @@ static int ffi_pdf_obj_put(js_State *J, void *obj, const char *key)
if (is_number(key, &idx)) {
fz_try(ctx)
- if (idx == pdf_array_len(ctx, obj))
- pdf_array_push(ctx, obj, val);
- else
- pdf_array_put(ctx, obj, idx, val);
+ pdf_array_put(ctx, obj, idx, val);
fz_always(ctx)
pdf_drop_obj(ctx, val);
fz_catch(ctx)