summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2009-05-03 20:56:42 +0200
committerSebastian Rasmussen <sebras@hotmail.com>2009-05-03 20:56:42 +0200
commitee686f2220b4355f67067fb024b1809acd433237 (patch)
tree1352010826943ca3348afc090fbad07c9e52c6bd
parent2d9337b2d962cd4fdc187eca12765659fc4a0e5b (diff)
downloadmupdf-ee686f2220b4355f67067fb024b1809acd433237.tar.xz
Take care of error cases when enlarging page tree runs out of memory.
-rw-r--r--mupdf/pdf_pagetree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mupdf/pdf_pagetree.c b/mupdf/pdf_pagetree.c
index 91ac887f..07268b1a 100644
--- a/mupdf/pdf_pagetree.c
+++ b/mupdf/pdf_pagetree.c
@@ -84,6 +84,8 @@ loadpagetree(pdf_xref *xref, pdf_pagetree *pages,
pages->count = pages->cursor + 10;
pages->pref = fz_realloc(pages->pref, sizeof(fz_obj*) * pages->count);
pages->pobj = fz_realloc(pages->pobj, sizeof(fz_obj*) * pages->count);
+ if (!pages->pref || !pages->pobj)
+ return fz_throw("error allocating enlarged page tree");
}
pages->pref[pages->cursor] = fz_keepobj(ref);