summaryrefslogtreecommitdiff
path: root/fitz/filt_predict.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-09-06 13:46:23 +0100
committerRobin Watts <robin.watts@artifex.com>2012-09-21 10:58:19 +0100
commit33433b148528ae863f651f49486e20bbcd6ebbb2 (patch)
tree65eef171ac4003da73ad9f76d211ccec2defb5d5 /fitz/filt_predict.c
parent9e609e1dcf6a1dac9195a4cfecac2a573ba42433 (diff)
downloadmupdf-33433b148528ae863f651f49486e20bbcd6ebbb2.tar.xz
Move defaulting of image params into predictor function.
This makes no difference to the current operation of the code, but ensures that 'saner' values are put into the image_params structure. This will help pdfwrite give more aesthetically pleasing output later.
Diffstat (limited to 'fitz/filt_predict.c')
-rw-r--r--fitz/filt_predict.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fitz/filt_predict.c b/fitz/filt_predict.c
index b82c1281..015d4a13 100644
--- a/fitz/filt_predict.c
+++ b/fitz/filt_predict.c
@@ -199,6 +199,15 @@ fz_open_predict(fz_stream *chain, int predictor, int columns, int colors, int bp
fz_var(state);
+ if (predictor < 1)
+ predictor = 1;
+ if (columns < 1)
+ columns = 1;
+ if (colors < 1)
+ colors = 1;
+ if (bpc < 1)
+ bpc = 8;
+
fz_try(ctx)
{
state = fz_malloc_struct(ctx, fz_predict);