diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2017-06-01 16:33:02 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2017-06-01 16:33:02 +0800 |
commit | 1ec306edc6636d35c51a4ba48b1c52e0266fac32 (patch) | |
tree | 81f3c450163fb23a392f824ec3fce802750aed29 /source | |
parent | 2d68de96c62c1e6d6a2b615336d99b671fc672b7 (diff) | |
download | mupdf-1ec306edc6636d35c51a4ba48b1c52e0266fac32.tar.xz |
tiff: Check for degenerate YCbCr subsampling factors.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/load-tiff.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c index 4587b345..2a0029d8 100644 --- a/source/fitz/load-tiff.c +++ b/source/fitz/load-tiff.c @@ -1100,6 +1100,8 @@ tiff_decode_ifd(fz_context *ctx, struct tiff *tiff) fz_throw(ctx, FZ_ERROR_GENERIC, "unsupported samples per pixel when subsampling"); if (tiff->bitspersample != 8) fz_throw(ctx, FZ_ERROR_GENERIC, "unsupported bits per sample when subsampling"); + if (tiff->ycbcrsubsamp[0] == 0 || tiff->ycbcrsubsamp[1] == 0) + fz_throw(ctx, FZ_ERROR_GENERIC, "unsupported subsampling factor"); } tiff->stride = (tiff->imagewidth * tiff->samplesperpixel * tiff->bitspersample + 7) / 8; |