diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-07-26 01:15:46 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2012-07-26 01:17:40 +0200 |
commit | 72b3934e17440e1b9faa885d63153e0fe17e2401 (patch) | |
tree | aa4c1f11f70cff23510e8d001d7fa08b6efb167f | |
parent | d43ce7650d60ec02a0d9def17cc40ceb9d2cbf98 (diff) | |
download | mupdf-72b3934e17440e1b9faa885d63153e0fe17e2401.tar.xz |
Assume default values for negative image parameters
If predictor, number of columns, number of colors or bits per component is
negative assume default value.
-rw-r--r-- | pdf/pdf_stream.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pdf/pdf_stream.c b/pdf/pdf_stream.c index 829210ea..a4af8e39 100644 --- a/pdf/pdf_stream.c +++ b/pdf/pdf_stream.c @@ -59,10 +59,10 @@ 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 (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); |