diff --git a/external/libtiff/UnpackedTarball_libtiff.mk b/external/libtiff/UnpackedTarball_libtiff.mk index 7f27c8d3fee7..dbd4c2c54d7c 100644 --- a/external/libtiff/UnpackedTarball_libtiff.mk +++ b/external/libtiff/UnpackedTarball_libtiff.mk @@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libtiff,\ external/libtiff/libtiff.linknolibs.patch \ external/libtiff/0001-ofz-54685-Timeout.patch \ external/libtiff/ofz65182.patch \ + external/libtiff/ofz68840.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libtiff/ofz68840.patch b/external/libtiff/ofz68840.patch new file mode 100644 index 000000000000..0a8721ebe012 --- /dev/null +++ b/external/libtiff/ofz68840.patch @@ -0,0 +1,17 @@ +--- 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) + {