summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-form.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-07-10 12:58:57 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-08-10 12:09:33 +0200
commit09f2e173850e011e6390c49a4f761e87dd87ffba (patch)
tree6026165eb2c859792e1c9c3578d470a4e6837f72 /source/pdf/pdf-form.c
parent62876a7025e31897e7ccb92ff8d461d3fef6ddb4 (diff)
downloadmupdf-09f2e173850e011e6390c49a4f761e87dd87ffba.tar.xz
Clean up null/range/endstream filter.
Use separate functions to keep the code simpler. Use memmem to simplify and optimize search for 'endstream' token. Do not look for 'endobj' since that could cause a false positives in compressed object streams that have duff lengths.
Diffstat (limited to 'source/pdf/pdf-form.c')
-rw-r--r--source/pdf/pdf-form.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/pdf/pdf-form.c b/source/pdf/pdf-form.c
index d6969ce7..a838b4b8 100644
--- a/source/pdf/pdf-form.c
+++ b/source/pdf/pdf-form.c
@@ -1245,7 +1245,7 @@ int pdf_signature_widget_byte_range(fz_context *ctx, pdf_document *doc, pdf_widg
for (i = 0; i < n; i++)
{
byte_range[i].offset = pdf_array_get_int(ctx, br, 2*i);
- byte_range[i].len = pdf_array_get_int(ctx, br, 2*i+1);
+ byte_range[i].length = pdf_array_get_int(ctx, br, 2*i+1);
}
}
@@ -1268,7 +1268,7 @@ fz_stream *pdf_signature_widget_hash_bytes(fz_context *ctx, pdf_document *doc, p
pdf_signature_widget_byte_range(ctx, doc, widget, byte_range);
}
- bytes = fz_open_null_n(ctx, doc->file, byte_range, byte_range_len);
+ bytes = fz_open_range_filter(ctx, doc->file, byte_range, byte_range_len);
}
fz_always(ctx)
{