f78a9d7d86
Change-Id: I0242059b17d07c0ab4ec83aabd073ee31c4631d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161031 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
23 lines
1 KiB
Diff
23 lines
1 KiB
Diff
diff --git a/libtiff/tif_strip.c b/libtiff/tif_strip.c
|
|
index 820a2544..afd7cb6e 100644
|
|
--- a/libtiff/tif_strip.c
|
|
+++ b/libtiff/tif_strip.c
|
|
@@ -287,7 +287,17 @@ uint64_t TIFFScanlineSize64(TIFF *tif)
|
|
else
|
|
{
|
|
uint64_t scanline_samples;
|
|
- scanline_samples = _TIFFMultiply64(tif, td->td_imagewidth,
|
|
+ uint32_t scanlinewidth = td->td_imagewidth;
|
|
+
|
|
+ if (td->td_photometric == PHOTOMETRIC_YCBCR)
|
|
+ {
|
|
+ uint16_t SubsamplingHor, SubsamplingVer;
|
|
+ TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &SubsamplingHor, &SubsamplingVer);
|
|
+ if (SubsamplingHor > 1) // roundup width for YCbCr
|
|
+ scanlinewidth = TIFFroundup_32(scanlinewidth, SubsamplingHor);
|
|
+ }
|
|
+
|
|
+ scanline_samples = _TIFFMultiply64(tif, scanlinewidth,
|
|
td->td_samplesperpixel, module);
|
|
scanline_size =
|
|
TIFFhowmany_64(_TIFFMultiply64(tif, scanline_samples,
|