summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-object.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-06-09 14:02:16 +0200
committerTor Andersson <tor.andersson@artifex.com>2014-06-09 16:23:11 +0200
commita6f0d56d2d2e66cef2b4ca6e810bf3630ed53d0b (patch)
tree1bfc678529b37d58643da6138f0e51a1bb40c6d1 /source/pdf/pdf-object.c
parent0f0653cac62c7dbcd4b4cd2ea57640769271365c (diff)
downloadmupdf-a6f0d56d2d2e66cef2b4ca6e810bf3630ed53d0b.tar.xz
Fix 695300: don't throw exception on invalid reference number.
Return the null object rather than throwing an exception when parsing indirect object references with negative object numbers. Do range check for object numbers (1 .. length) when object numbers are used instead. Object number 0 is not a valid object number. It must always be 'free'.
Diffstat (limited to 'source/pdf/pdf-object.c')
-rw-r--r--source/pdf/pdf-object.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c
index 6fd69bbd..51272dea 100644
--- a/source/pdf/pdf-object.c
+++ b/source/pdf/pdf-object.c
@@ -158,10 +158,6 @@ pdf_new_indirect(pdf_document *doc, int num, int gen)
{
pdf_obj *obj;
fz_context *ctx = doc->ctx;
-
- if (num <= 0 || gen < 0)
- fz_throw(ctx, FZ_ERROR_GENERIC, "Invalid num (%d) or gen (%d) for indirection", num, gen);
-
obj = Memento_label(fz_malloc(ctx, sizeof(pdf_obj)), "pdf_obj(indirect)");
obj->doc = doc;
obj->refs = 1;