diff options
-rw-r--r-- | fitz/filt_predict.c | 9 | ||||
-rw-r--r-- | pdf/pdf_stream.c | 5 |
2 files changed, 9 insertions, 5 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); diff --git a/pdf/pdf_stream.c b/pdf/pdf_stream.c index a81ecb18..b8a8f5c6 100644 --- a/pdf/pdf_stream.c +++ b/pdf/pdf_stream.c @@ -58,11 +58,6 @@ build_filter(fz_stream *chain, pdf_document * xref, pdf_obj * f, pdf_obj * p, in int colors = pdf_to_int(pdf_dict_gets(p, "Colors")); int bpc = pdf_to_int(pdf_dict_gets(p, "BitsPerComponent")); - if (predictor <= 0) predictor = 1; - if (columns <= 0) columns = 1; - if (colors <= 0) colors = 1; - if (bpc <= 0) bpc = 8; - if (!strcmp(s, "ASCIIHexDecode") || !strcmp(s, "AHx")) return fz_open_ahxd(chain); |