summaryrefslogtreecommitdiff
path: root/apps/pdfextract.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-11-20 02:47:10 +0100
committerTor Andersson <tor@ghostscript.com>2009-11-20 02:47:10 +0100
commit549dbe8e5563f9a228c8de35f07d0108e3adf74c (patch)
tree535331b85b257ceaf44b9d2bfae67742ea4968d8 /apps/pdfextract.c
parent856c0c8335d9a0a861558f92cd35c0cf3b5007c3 (diff)
downloadmupdf-549dbe8e5563f9a228c8de35f07d0108e3adf74c.tar.xz
As a new code policy in MuPDF, malloc cannot return NULL. As a result we can get rid of large chunks of untested error handling code. This patch cleans up the handling of fz_obj.
Diffstat (limited to 'apps/pdfextract.c')
-rw-r--r--apps/pdfextract.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/pdfextract.c b/apps/pdfextract.c
index 2bead4c5..4f4fb24a 100644
--- a/apps/pdfextract.c
+++ b/apps/pdfextract.c
@@ -38,14 +38,10 @@ static void saveimage(fz_obj *obj, int num, int gen)
int x;
int y;
- error = fz_newindirect(&ref, num, gen, xref);
- if (error)
- die(error);
-
- error = pdf_newstore(&xref->store);
- if (error)
- die(error);
+ ref = fz_newindirect(num, gen, xref);
+ xref->store = pdf_newstore();
+
error = pdf_loadimage(&img, xref, ref);
if (error)
die(error);