office-gobmx/external/libtiff/ofz68840.patch
Caolán McNamara 034b68eb3a ofz#68840 another putcontig8bitYCbCr22tile issue
Change-Id: I6e119cf1b3bec609f94784eb0c439835875d6112
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168031
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-25 21:04:17 +02:00

17 lines
643 B
Diff

--- a/libtiff/tif_tile.c
+++ b/libtiff/tif_tile.c
@@ -233,7 +233,13 @@
_TIFFMultiply64(tif, samplingrow_size, samplingblocks_ver, module));
}
else
- return (_TIFFMultiply64(tif, nrows, TIFFTileRowSize64(tif), module));
+ {
+ uint64_t row_size = TIFFTileRowSize64(tif);
+ /* I think the way this works the expectation is there are always even num of samples */
+ if (td->td_photometric == PHOTOMETRIC_YCBCR)
+ row_size = TIFFroundup_64(row_size, 2);
+ return (_TIFFMultiply64(tif, nrows, row_size, module));
+ }
}
tmsize_t TIFFVTileSize(TIFF *tif, uint32_t nrows)
{