From 1ec306edc6636d35c51a4ba48b1c52e0266fac32 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Thu, 1 Jun 2017 16:33:02 +0800 Subject: tiff: Check for degenerate YCbCr subsampling factors. --- source/fitz/load-tiff.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/fitz') 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; -- cgit v1.2.3