diff options
-rw-r--r-- | source/fitz/output-pcl.c | 6 | ||||
-rw-r--r-- | source/fitz/output-png.c | 3 | ||||
-rw-r--r-- | source/fitz/output-pnm.c | 9 | ||||
-rw-r--r-- | source/fitz/output-ps.c | 3 | ||||
m--------- | thirdparty/jbig2dec | 0 |
5 files changed, 21 insertions, 0 deletions
diff --git a/source/fitz/output-pcl.c b/source/fitz/output-pcl.c index 4485453a..4eb620f3 100644 --- a/source/fitz/output-pcl.c +++ b/source/fitz/output-pcl.c @@ -782,6 +782,9 @@ color_pcl_write_band(fz_context *ctx, fz_band_writer *writer_, int stride, int b unsigned char *curr; unsigned char *comp; + if (!out) + return; + ds = w * 3; ss = w * 4; @@ -1149,6 +1152,9 @@ mono_pcl_write_band(fz_context *ctx, fz_band_writer *writer_, int ss, int band_s int out_count; const fz_pcl_options *pcl; + if (!out) + return; + num_blank_lines = writer->num_blank_lines; rmask = ~0 << (-w & 7); line_size = (w + 7)/8; diff --git a/source/fitz/output-png.c b/source/fitz/output-png.c index 24e9394f..993bda9f 100644 --- a/source/fitz/output-png.c +++ b/source/fitz/output-png.c @@ -133,6 +133,9 @@ png_write_band(fz_context *ctx, fz_band_writer *writer_, int stride, int band_st int y, x, k, err, finalband; int w, h, n; + if (!out) + return; + w = writer->super.w; h = writer->super.h; n = writer->super.n; diff --git a/source/fitz/output-pnm.c b/source/fitz/output-pnm.c index 3a605524..68f25bcb 100644 --- a/source/fitz/output-pnm.c +++ b/source/fitz/output-pnm.c @@ -39,6 +39,9 @@ pnm_write_band(fz_context *ctx, fz_band_writer *writer, int stride, int band_sta if (n-alpha != 1 && n-alpha != 3) fz_throw(ctx, FZ_ERROR_GENERIC, "pixmap must be grayscale or rgb to write as pnm"); + if (!out) + return; + if (end > h) end = h; end -= band_start; @@ -78,6 +81,9 @@ pnm_write_band(fz_context *ctx, fz_band_writer *writer, int stride, int band_sta break; } case 3: + fz_write(ctx, out, p, num_written*3); + p += num_written*3; + break; case 4: { char *o = buffer; @@ -188,6 +194,9 @@ pam_write_band(fz_context *ctx, fz_band_writer *writer, int stride, int band_sta int y; int end = band_start + band_height; + if (!out) + return; + if (end > h) end = h; end -= band_start; diff --git a/source/fitz/output-ps.c b/source/fitz/output-ps.c index 8b8d9bdb..b5338955 100644 --- a/source/fitz/output-ps.c +++ b/source/fitz/output-ps.c @@ -187,6 +187,9 @@ ps_write_band(fz_context *ctx, fz_band_writer *writer_, int stride, int band_sta int required_output; unsigned char *o; + if (!out) + return; + if (band_start+band_height >= h) band_height = h - band_start; diff --git a/thirdparty/jbig2dec b/thirdparty/jbig2dec -Subproject 9d2c4f3bdb0bd003deae788e7187c0f86e62454 +Subproject e698d5c11d27212aa1098bc5b1673a337856309 |