summaryrefslogtreecommitdiff
path: root/fitz/filt_faxd.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-11-20 21:29:56 +0100
committerTor Andersson <tor@ghostscript.com>2009-11-20 21:29:56 +0100
commita16d9e0c25ed986c57c521aa87d87f6c343218a7 (patch)
tree9b0a38819ce69b9f1f9a187504224411d2dd8074 /fitz/filt_faxd.c
parent549dbe8e5563f9a228c8de35f07d0108e3adf74c (diff)
downloadmupdf-a16d9e0c25ed986c57c521aa87d87f6c343218a7.tar.xz
Malloc cannot return null. Clean up streams and filters.
Diffstat (limited to 'fitz/filt_faxd.c')
-rw-r--r--fitz/filt_faxd.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/fitz/filt_faxd.c b/fitz/filt_faxd.c
index 7a5cb774..7a244dfa 100644
--- a/fitz/filt_faxd.c
+++ b/fitz/filt_faxd.c
@@ -165,8 +165,8 @@ struct fz_faxd_s
unsigned char *dst;
};
-fz_error
-fz_newfaxd(fz_filter **fp, fz_obj *params)
+fz_filter *
+fz_newfaxd(fz_obj *params)
{
fz_obj *obj;
@@ -216,24 +216,12 @@ fz_newfaxd(fz_filter **fp, fz_obj *params)
fax->eolc = 0;
fax->ref = fz_malloc(fax->stride);
- if (!fax->ref)
- {
- fz_free(fax);
- return fz_rethrow(-1, "out of memory: scanline buffer one");
- }
-
fax->dst = fz_malloc(fax->stride);
- if (!fax->dst)
- {
- fz_free(fax->ref);
- fz_free(fax);
- return fz_rethrow(-1, "out of memory: scanline buffer two");
- }
memset(fax->ref, 0, fax->stride);
memset(fax->dst, 0, fax->stride);
- return fz_okay;
+ return (fz_filter*)fz_okay;
}
void