summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-02-15 16:46:59 +0000
committerRobin Watts <robin.watts@artifex.com>2012-02-15 16:47:45 +0000
commited36cf036ee450fdfa872de9c3996047a7761cb6 (patch)
treedeeb974432fc4ff9aaf07b9892e7ab5444deb5e4 /pdf
parent27bc1ae4c5b3bdc18f53fb65f06b1d27c8fd71a6 (diff)
downloadmupdf-ed36cf036ee450fdfa872de9c3996047a7761cb6.tar.xz
Add braces to resolve ambiguity.
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_xref.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c
index 04437586..7500ded3 100644
--- a/pdf/pdf_xref.c
+++ b/pdf/pdf_xref.c
@@ -469,12 +469,14 @@ pdf_load_xref(pdf_document *xref, char *buf, int bufsize)
for (i = 0; i < xref->len; i++)
{
if (xref->table[i].type == 'n')
+ {
/* Special case code: "0000000000 * n" means free,
* according to some producers (inc Quartz) */
if (xref->table[i].ofs == 0)
xref->table[i].type = 'f';
else if (xref->table[i].ofs <= 0 || xref->table[i].ofs >= xref->file_size)
fz_throw(ctx, "object offset out of range: %d (%d 0 R)", xref->table[i].ofs, i);
+ }
if (xref->table[i].type == 'o')
if (xref->table[i].ofs <= 0 || xref->table[i].ofs >= xref->len || xref->table[xref->table[i].ofs].type != 'n')
fz_throw(ctx, "invalid reference to an objstm that does not exist: %d (%d 0 R)", xref->table[i].ofs, i);